Commit a74b095d authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

force enable loop player for internal access

parent 88148030
......@@ -3,6 +3,8 @@ var List;
var markers = [];
var selected;
var BLOCK_MOVEEND = false;
$(function(){
......@@ -47,32 +49,65 @@ var Dragged = false;
function init_dragging(){
var bigcounter = 0;
$("#model_table img").on("load",function(){
bigcounter++;
if (bigcounter==markers.length){
actual_dragging_init();
if (SETTINGS.model!==undefined){
var inviscounter = 0;
markers.forEach(function(c,i){
if (!$(".arow[index="+i+"]").is(":visible")) {
inviscounter++;
}
find_preselected_index();
$(".arow")[selected].click();
place_selected_thumbnail();
if(c[0].name==SETTINGS.model){
$(".arow")[i].click();
$("#model_table").css({
top: -106*(i-inviscounter)+"px"
});
}
});
}else{
// if not defined then do not click at '0' - this will allow to place view properly
}
//$(".arow")[0].click();
}
});
}
function find_preselected_index(){
markers.forEach(function(c,i){
if (c[0].name==SETTINGS.model){
selected = i;
}
});
if (selected === undefined){
selected = 0;
}
}
function place_selected_thumbnail(){
var inviscounter = 0;
markers.forEach(function(c,i){
if (!$(".arow[index="+i+"]").is(":visible")) {
inviscounter++;
}
//if(c[0].name==SETTINGS.model){
if (i==selected){
//$(".arow")[i].click();
$("#model_table").css({
top: -106*(i-inviscounter)+"px"
});
}
});
}
function actual_dragging_init(){
var list = document.getElementById('model_table');
......@@ -173,6 +208,7 @@ function parse_list(res){
//console.log("clicked"+this.index);
// find all markers under this marker
$(".arow[index="+this.index+"]").click();
//place_selected_thumbnail();
});
if (markers[index]==undefined) {
......@@ -237,6 +273,9 @@ function register_row_events(elem){
map.panTo(new L.LatLng(lat, lng));
if (markers[index]!=undefined){
selected = index;
// find all markers under this marker
var tmp = popup_message(markers[index]);
markers[index][0]._popup.setContent(tmp);
......@@ -365,6 +404,8 @@ function init_maps(){
});
//place_selected_thumbnail();
var center = map.getCenter();
var zoom = map.getZoom();
......
......@@ -65,7 +65,8 @@ var SETTINGS = {
'x3d':"",
'kml':""
},
'forcehide':[]
'forcehide':[],
'forceshow':[]
// 'kml' : "scene.kml"
}
......
......@@ -193,12 +193,20 @@ function save_rating_init(){
url: "store_rating.php?model="+SETTINGS.path,
complete: function(response){
var value = parseInt(response.responseText);
// this check defines if the page is public or private
if (isNaN(value)){
value = 5;
// add elements ids
SETTINGS.forcehide.push("model_rating_tr");
SETTINGS.forcehide.push("kml_tr");
SETTINGS.forcehide.push("#model_rating_tr");
SETTINGS.forcehide.push("#kml_tr");
}else{
SETTINGS.forceshow.push(".experimental");
}
$("#model_rating").val(value);
// bind onchange
$("#model_rating").on('change',function(){
......@@ -240,17 +248,18 @@ function controls_showhide(){
if (!SETTINGS.experimental){
$(".experimental").hide();
SETTINGS.forceshow.forEach(function(c,i){$(c).show();});
}else{
$(".experimental").show();
SETTINGS.forcehide.forEach(function(c,i){$(c).hide();});
}
if (!SETTINGS.edit){
$(".edit").hide();
SETTINGS.forceshow.forEach(function(c,i){$(c).show();});
}else{
$(".edit").show();
SETTINGS.forcehide.forEach(function(c,i){
$("#"+c).hide();
});
SETTINGS.forcehide.forEach(function(c,i){$(c).hide();});
align_position();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment