c80_map_floors 0.2.0.1 → 0.2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2597a223d11b4fb3705f4659ceb15607a297d3f3
4
- data.tar.gz: 1c9cd5b88f9585da75b252bf5d0cb3963895ec0c
3
+ metadata.gz: 77ebe44a0378af5a19e6de44236f282bf0fa8475
4
+ data.tar.gz: 2fb133e8612f1a36c9552fda8a6129749bf1c49c
5
5
  SHA512:
6
- metadata.gz: a63e2caff22da7243b43746bd2cfd92e4e534c58fbcbb89887bdc1667b1dc2ecd1b69d0a6da8cc1e77b78bd58bc5cf7c715d96201b1196356e0e784aff018ef8
7
- data.tar.gz: 8d3e8e79f3c92d102c3fa6e97a194a73c810b52c5e08373905d6d0d6fe8219c300aca57cb1d3528b832d3d0b26e61e11e6c6c1860584912e2abb79f6012c71cb
6
+ metadata.gz: c3b3119465cda2ec42ccf164871c688a6708a435913c22a5dd6aafae375813b3610b11b0a894f6ae454962de0283f0d893987e7f1cc97b85fa71165c0d75f1a6
7
+ data.tar.gz: '0308db356713cf2c227a8223b8626dd534c3ed12816ed03994ea35007e5e0f0cdae0779ab7d2b2b3dde83602150ad47703dcd402ea1f7e484d4fef9e4541cb3d'
data/README.md CHANGED
@@ -72,7 +72,7 @@ $(document).ready(function() {
72
72
  dnd_enable:false,
73
73
  debug: true,
74
74
  left_padding: 50,
75
- right_padding: 50,
75
+ top_padding: 50,
76
76
  focus_area_width: 500,
77
77
  focus_area_height: 500,
78
78
  bounding_box: {
@@ -6,8 +6,9 @@ var map_on_index_page = null;
6
6
  var InitMap = function (params) {
7
7
 
8
8
  var dnd_enable = true;
9
- if (params != undefined && params["dnd_enable"] != undefined) {
10
- dnd_enable = params["dnd_enable"];
9
+ //noinspection EqualityComparisonWithCoercionJS
10
+ if (params != undefined && params['dnd_enable'] != undefined) {
11
+ dnd_enable = params['dnd_enable'];
11
12
  }
12
13
 
13
14
  // - to delete start -----------------------------------------------------------------------------------------------------------------------
@@ -123,7 +124,7 @@ var InitMap = function (params) {
123
124
 
124
125
  self.init = function (el, params) {
125
126
 
126
- console.log('<Map.init>');
127
+ console.log('[Map.init]');
127
128
 
128
129
  // extend options
129
130
  self.o = $.extend(self.o, params);
@@ -229,7 +230,7 @@ var InitMap = function (params) {
229
230
  //.addClass(data["class_name"])/* [qwwqq] */
230
231
  .addClass("main_map")/* [qwwqq] */
231
232
  .appendTo(self.map_layers); // .hide()
232
- $('<img>').attr('src', data["img"]).addClass('mmap-image').appendTo(layer);
233
+ $('<img src="">').attr('src', data["img"]).addClass('mmap-image').appendTo(layer);
233
234
 
234
235
  // Zoom buttons
235
236
  if (self.o.zoombuttons) {
@@ -253,7 +254,7 @@ var InitMap = function (params) {
253
254
  div_css_selector: '#container_buttons .mzoom_buttons'
254
255
  }
255
256
  }).done(function () {
256
- console.log('<ajax.done>');
257
+ console.log('[ajax.done]');
257
258
 
258
259
  self.update_json_klass = new UpdateJsonButton();
259
260
  self.update_json_klass.init('.mapplic-update-json', self);
@@ -327,7 +328,7 @@ var InitMap = function (params) {
327
328
  // self.Y10,
328
329
  // self.Y20);
329
330
  // var scale = (scaleX < scaleY) ? scaleX : scaleY;
330
- // self.scale = scaleX;
331
+ // self.scale = scale;
331
332
 
332
333
  self.scale = scaleX;
333
334
  //</editor-fold>
@@ -386,14 +387,15 @@ var InitMap = function (params) {
386
387
  //#-> Убрал 'edit_building', т.к. мы не можем ничего нарисовать в этом режиме - картинки этажей добавляются через админку
387
388
  if (self.mode === 'editing' || self.mode === 'edit_area' || self.mode === 'edit_floor') { // || self.mode === "edit_building"
388
389
  if (e.target.parentNode.tagName === 'g') {
389
- console.log("<onSvgMousedown> Нажали мышью на полигон или вершину.");
390
+ console.log("[onSvgMousedown] Нажали мышью на полигон или вершину.");
390
391
  //console.log(e.pageX);
391
- //console.log("<mouseDown> e.target.parentNode.tagName = " + e.target.parentNode.tagName);
392
+ //console.log("[mouseDown] e.target.parentNode.tagName = " + e.target.parentNode.tagName);
392
393
  //console.log(e.target);
393
394
  //info.unload();
394
395
 
395
396
  // если ДО этого нажатия уже была "выбранная" область - "снимем" с неё css класс
396
- if (self.selected_area != null && self.selected_area != undefined) {
397
+ //noinspection EqualityComparisonWithCoercionJS
398
+ if (self.selected_area != null) {
397
399
  self.selected_area.deselect();
398
400
  }
399
401
 
@@ -433,16 +435,20 @@ var InitMap = function (params) {
433
435
  //self.edit_type = 'move';
434
436
 
435
437
  // если это полигон здания - фиксируем его
436
- var selected_area_building = self.selected_area.building;
437
- if (selected_area_building != undefined && selected_area_building != null) {
438
- self.current_building = selected_area_building; // фиксируем полигон здания в режиме "редактирования карты" при клике по полигону на карте
439
- console.log("<self.onSvgMousedown> Это не Drag-n-drop, а обычный клик по полигону Здания c id=" + self.current_building.options["id"]);
438
+ //noinspection EqualityComparisonWithCoercionJS
439
+ if (self.selected_area != null) {
440
+ var selected_area_building = self.selected_area.building;
441
+ //noinspection EqualityComparisonWithCoercionJS
442
+ if (selected_area_building != null) {
443
+ self.current_building = selected_area_building; // фиксируем полигон здания в режиме "редактирования карты" при клике по полигону на карте
444
+ console.log("[self.onSvgMousedown] Это не Drag-n-drop, а обычный клик по полигону Здания c id=" + self.current_building.options["id"]);
440
445
 
441
- // включим кнопку "связать Здание"
442
- self.building_link_button_klass.en_check();
446
+ // включим кнопку "связать Здание"
447
+ self.building_link_button_klass.en_check();
443
448
 
444
- } else {
445
- console.log("<self.onSvgMousedown> Это не Drag-n-drop, а обычный клик по фигуре.");
449
+ } else {
450
+ console.log("[self.onSvgMousedown] Это не Drag-n-drop, а обычный клик по фигуре.");
451
+ }
446
452
  }
447
453
 
448
454
  }
@@ -462,11 +468,12 @@ var InitMap = function (params) {
462
468
 
463
469
  // Drag & drop
464
470
  function onDragNdrop(event) {
465
- //console.log("<mousedown> edit_type = " + self.edit_type);
466
- console.log("<mousedown> mode = " + self.mode + ", dnd_enable = " + self.o.dnd_enable + ', edit_type = ' + self.edit_type);
471
+ //console.log("[mousedown] edit_type = " + self.edit_type);
472
+ console.log("[mousedown] mode = " + self.mode + ", dnd_enable = " + self.o.dnd_enable + ', edit_type = ' + self.edit_type);
467
473
  //console.log(event);
468
474
 
469
475
  // если в данный момент не редактируем фигуру (т.е. не двигаем вершину фигуры)
476
+ //noinspection EqualityComparisonWithCoercionJS
470
477
  if (self.edit_type == null) {
471
478
  self.dragging = false;
472
479
  map.stop();
@@ -496,8 +503,8 @@ var InitMap = function (params) {
496
503
  scale: self.scale
497
504
  });
498
505
 
499
- //console.log("<Map.mousemove> x = " + x + "; y = " + y);
500
- //console.log("<Map.mousemove> Call moveTo.");
506
+ //console.log("[Map.mousemove] x = " + x + "; y = " + y);
507
+ //console.log("[Map.mousemove] Call moveTo.");
501
508
  self.moveTo(x, y); /* NOTE:: вызывается во время dnd */
502
509
  map.data('lastX', x);
503
510
  map.data('lastY', y);
@@ -506,16 +513,16 @@ var InitMap = function (params) {
506
513
 
507
514
  //noinspection JSUnresolvedFunction
508
515
  $(document).on('mouseup', function (event) {
509
- //console.log("<mouseup> dragging = " + self.dragging + ", mode = " + self.mode + "; is_draw = " + self.is_draw + "; scale = " + self.scale);
510
- //console.log("<mouseup> event = ");
516
+ //console.log("[mouseup] dragging = " + self.dragging + ", mode = " + self.mode + "; is_draw = " + self.is_draw + "; scale = " + self.scale);
517
+ //console.log("[mouseup] event = ");
511
518
  //console.log(event);
512
- //console.log("<mouseup> event.target = ");
519
+ //console.log("[mouseup] event.target = ");
513
520
  //console.log($(event.target).parent()[0].obj);
514
521
 
515
- //console.log("<mouseup> [qq] screen: " + event.pageX + ", " + event.pageY +
522
+ //console.log("[mouseup] [qq] screen: " + event.pageX + ", " + event.pageY +
516
523
  //"; logic: " + self.rightX(event.pageX) + ", " + self.rightY(event.pageY));
517
524
 
518
- console.log("<mouseup> Отпустили мышь после клика, текущий режим карты: mode = " + self.mode);
525
+ console.log("[mouseup] Отпустили мышь после клика, текущий режим карты: mode = " + self.mode);
519
526
 
520
527
  // исключаем случайный dnd дрожащей рукой [xdnd?]
521
528
  var dx = map.data('startX') - map.data('lastX');
@@ -537,14 +544,14 @@ var InitMap = function (params) {
537
544
  var $viewing_g_from_svg_overlay;
538
545
 
539
546
  /* если находимся в режиме просмотра всей карты - входим в здание */
540
- if (self.mode == 'viewing') {
547
+ if (self.mode === 'viewing') {
541
548
  //console.log($(event.target).parent()[0].obj.building);
542
549
 
543
550
  // добираемся до объекта класса Здание, который обслуживает полигон
544
551
  p = $(event.target).parent()[0];
545
552
  if (p.obj && p.obj.building) {
546
553
  var building = p.obj.building;
547
- console.log("<mouseup> Текущий mode карты 'viewing' => Входим в здание (а потом building сам решит, входить ли на 1й этаж).");
554
+ console.log("[mouseup] Текущий mode карты 'viewing' - Входим в здание (а потом building сам решит, входить ли на 1й этаж).");
548
555
  self.current_building = building; /* когда вошли в здание, определили переменную */
549
556
  building.enter();
550
557
  }
@@ -552,14 +559,14 @@ var InitMap = function (params) {
552
559
  }
553
560
 
554
561
  /* если находимся в режиме рисования - рисуем */
555
- else if (self.mode == 'creating') {
562
+ else if (self.mode === 'creating') {
556
563
 
557
564
  // и если ещё пока не начали рисовать (т.е. если это первый клик)
558
565
  if (!self.is_draw) {
559
566
 
560
567
  var xx = self.rightX(event.pageX);
561
568
  var yy = self.rightY(event.pageY);
562
- //console.log("<mouseup> " + xx + "; " + yy);
569
+ //console.log("[mouseup] " + xx + "; " + yy);
563
570
 
564
571
  self.drawing_poligon = new Polygon(xx, yy, false, self);
565
572
 
@@ -577,7 +584,7 @@ var InitMap = function (params) {
577
584
  // если кликнули в первую точку фигуры - заканчиваем рисование
578
585
  var $et = $(e.target);
579
586
  var $h = $(self.drawing_poligon.helpers[0].helper);
580
- if ($et.attr('x') == $h.attr('x') && $et.attr('y') == $h.attr('y')) {
587
+ if ($et.attr('x') === $h.attr('x') && $et.attr('y') === $h.attr('y')) {
581
588
  //self.drawing_poligon.onDrawStop();
582
589
  self.onDrawStop();
583
590
  return;
@@ -600,7 +607,7 @@ var InitMap = function (params) {
600
607
 
601
608
  /* если находимся в режиме просмотра здания - входим в площадь (так было в c80_map) */
602
609
  /* если находится в режиме просмотра площади - переключаемся на другую площадь */
603
- else if (self.mode == 'view_floor' || self.mode == 'view_area') { // self.mode == 'view_building' (так было в c80_map)
610
+ else if (self.mode === 'view_floor' || self.mode === 'view_area') { // self.mode == 'view_building' (так было в c80_map)
604
611
 
605
612
  //console.log($(event.target).parent());
606
613
  // => g, который живёт в #svg_overlay, или, другими словами,
@@ -618,17 +625,17 @@ var InitMap = function (params) {
618
625
  self.last_clicked_g = $viewing_g_from_svg_overlay;
619
626
 
620
627
  var area = p.obj.area;
621
- console.log("<mouseup> Входим в площадь. self.last_clicked_g = ");
628
+ console.log("[mouseup] Входим в площадь. self.last_clicked_g = ");
622
629
  console.log(self.last_clicked_g);
623
630
  area.enter();
624
631
  } else {
625
- console.log('<mouseup> [ERROR] у полигона нет объекта Area.js класса.');
632
+ console.log('[mouseup] [ERROR] у полигона нет объекта Area.js класса.');
626
633
  }
627
634
 
628
635
  }
629
636
 
630
- else if (self.mode == 'removing') {
631
- console.log('<main.js> mode = removing');
637
+ else if (self.mode === 'removing') {
638
+ console.log('[main.js] mode = removing');
632
639
 
633
640
  // => g, который живёт в #svg_overlay, или, другими словами,
634
641
  // тот g, по которому кликнули последний раз,
@@ -643,7 +650,7 @@ var InitMap = function (params) {
643
650
  var area = p.obj.area;
644
651
  self.registerDeletingArea(area);
645
652
  } else {
646
- console.log('<main.js> [error] нету у полигона объекта, или этот объект не Area');
653
+ console.log('[main.js] [error] нету у полигона объекта, или этот объект не Area');
647
654
  }
648
655
 
649
656
  }
@@ -691,7 +698,7 @@ var InitMap = function (params) {
691
698
 
692
699
  // какой должен быть минимальный масштаб, чтобы вписать отрезок [min,max] в отрезок [p1,p2]
693
700
  self.calcScale = function (min, max, p1, p2) {
694
- //console.log("<calcScale> [" + min + "," + max + '] to [' + p1 + "," + p2 + "]");
701
+ //console.log("[calcScale] [" + min + "," + max + '] to [' + p1 + "," + p2 + "]");
695
702
  return (p2 - p1) / (max - min);
696
703
  };
697
704
 
@@ -765,10 +772,13 @@ var InitMap = function (params) {
765
772
  for (i = 0; i < to_draw.length; i++) {
766
773
  ip = to_draw[i];
767
774
 
775
+ //noinspection EqualityComparisonWithCoercionJS
768
776
  if (ip.x != undefined) {
769
777
  istyle = style_x.split("{X}").join(ip.x);
770
- } else if (ip.y != undefined) {
771
- istyle = style_y.split("{Y}").join(ip.y);
778
+ } else { //noinspection EqualityComparisonWithCoercionJS
779
+ if (ip.y != undefined) {
780
+ istyle = style_y.split("{Y}").join(ip.y);
781
+ }
772
782
  }
773
783
 
774
784
  _$m.append($("<div style=" + istyle + "></div>"));
@@ -832,8 +842,9 @@ var InitMap = function (params) {
832
842
  * можно было отобразить характеристики Здания родителя C80Rent:Building.
833
843
  */
834
844
  self.draw_childs = function (childs, parent_hash) {
845
+ //noinspection EqualityComparisonWithCoercionJS
835
846
  if (childs == undefined) return;
836
- console.log("<Map.draw_childs>");
847
+ console.log("[Map.draw_childs]");
837
848
 
838
849
  //var ip;
839
850
  var iobj;
@@ -864,6 +875,7 @@ var InitMap = function (params) {
864
875
  }
865
876
 
866
877
  // Только после того, как нарисуем всех детей на карте, подсветим результаты поиска
878
+ //noinspection EqualityComparisonWithCoercionJS
867
879
  if (self.search_gui_klass != null) {
868
880
  self.search_gui_klass.handleSearchResults();
869
881
  }
@@ -879,14 +891,14 @@ var InitMap = function (params) {
879
891
  */
880
892
  self.draw_child_bg_image = function (img_src, obj_type, is_overlay) {
881
893
  var t;
882
- if (is_overlay == true) {
894
+ if (is_overlay === true) {
883
895
  t = self.map_overlay_layers;
884
896
  } else {
885
897
  t = self.map_layers;
886
898
  }
887
899
  // Create new map layer
888
900
  var layer = $('<div></div>').addClass('mlayer').addClass(obj_type).appendTo(t); // .hide()
889
- $('<img>').attr('src', img_src).addClass('mmap-image').appendTo(layer);
901
+ $('<img src="">').attr('src', img_src).addClass('mmap-image').appendTo(layer);
890
902
 
891
903
  return layer;
892
904
  };
@@ -961,7 +973,7 @@ var InitMap = function (params) {
961
973
  var width = $i.data("width")*self.scale_during_animation;
962
974
  var height = $i.data("height")*self.scale_during_animation;
963
975
 
964
- console.log('<__compose_css_style_for_map_object_image>');
976
+ console.log('[__compose_css_style_for_map_object_image]');
965
977
 
966
978
  // впишем в DOM стили
967
979
  var style = 'top:';
@@ -981,21 +993,21 @@ var InitMap = function (params) {
981
993
  //<editor-fold desc="// двигаем фигуру мышкой методом drag-n-drop">
982
994
  self.onMouseMove = function (e) { // мышь нажата и двигается
983
995
 
984
- //console.log("<Polygon.prototype.onMouseMove> _s_f = " + _s_f);
985
- //console.log("<Polygon.prototype.onMouseMove> e = ");
996
+ //console.log("[Polygon.prototype.onMouseMove] _s_f = " + _s_f);
997
+ //console.log("[Polygon.prototype.onMouseMove] e = ");
986
998
  //console.log(_s_f);
987
999
  //console.log(e.pageX);
988
1000
 
989
1001
  var selected_area = self.selected_area;
990
1002
  var edit_type = self.edit_type;
991
- //console.log("<Polygon.prototype.onMouseMove> edit_type = " + edit_type);
1003
+ //console.log("[Polygon.prototype.onMouseMove] edit_type = " + edit_type);
992
1004
 
993
1005
  selected_area.dynamicEdit(selected_area[edit_type](e.pageX - selected_area.delta.x, e.pageY - selected_area.delta.y));
994
1006
  selected_area.delta.x = e.pageX;
995
1007
  selected_area.delta.y = e.pageY;
996
1008
  };
997
1009
  self.onMouseUp = function (e) { // отпустили мышь (другими словами - закончили drag'n'drop)
998
- console.log("<self.onMouseUp> [for_breakpoint] Отпустили мышь.");
1010
+ console.log("[self.onMouseUp] [for_breakpoint] Отпустили мышь.");
999
1011
 
1000
1012
  var _s_f = self.selected_area;
1001
1013
  var edit_type = self.edit_type;
@@ -1010,7 +1022,7 @@ var InitMap = function (params) {
1010
1022
  //
1011
1023
  // Если dnd был - двигаем фигуру
1012
1024
  //if (is_real_dragging) {
1013
- // console.log("<self.onMouseUp> Drag-n-drop detected.");
1025
+ // console.log("[self.onMouseUp] Drag-n-drop detected.");
1014
1026
  var aa = _s_f[edit_type](dx, dy);
1015
1027
  var bb = _s_f.dynamicEdit(aa);
1016
1028
  _s_f.setParams(bb);
@@ -1024,11 +1036,11 @@ var InitMap = function (params) {
1024
1036
  //var selected_area_building = self.selected_area.building;
1025
1037
  //if (selected_area_building != undefined && selected_area_building != null) {
1026
1038
  // self.current_building = selected_area_building;
1027
- // console.log("<self.onMouseUp> Это не Drag-n-drop, а обычный клик по полигону Здания c id=" + self.current_building.options.id);
1039
+ // console.log("[self.onMouseUp] Это не Drag-n-drop, а обычный клик по полигону Здания c id=" + self.current_building.options.id);
1028
1040
  //} else {
1029
- // console.log("<self.onMouseUp> Это не Drag-n-drop, а обычный клик по фигуре.");
1041
+ // console.log("[self.onMouseUp] Это не Drag-n-drop, а обычный клик по фигуре.");
1030
1042
  //}
1031
- //console.log('<breakpoint>');
1043
+ //console.log('[breakpoint]');
1032
1044
  //}
1033
1045
 
1034
1046
  self.removeAllEvents();
@@ -1036,10 +1048,11 @@ var InitMap = function (params) {
1036
1048
  //</editor-fold>
1037
1049
 
1038
1050
  self.onDrawStop = function (e) {
1039
- console.log("<Map.onDrawStop> Закончили рисовать.");
1051
+ console.log("[Map.onDrawStop] Закончили рисовать.");
1040
1052
 
1053
+ //noinspection EqualityComparisonWithCoercionJS
1041
1054
  if (e != undefined) {
1042
- if (e.type == 'keydown' && e.keyCode == 13) {
1055
+ if (e.type === 'keydown' && e.keyCode === 13) {
1043
1056
  // its ok, continue execution..
1044
1057
  } else {
1045
1058
  return
@@ -1056,8 +1069,8 @@ var InitMap = function (params) {
1056
1069
 
1057
1070
  //#-> создадим либо полигон Здания, либо полигон Площади
1058
1071
 
1059
- if (self.prev_mode == "edit_floor") {
1060
- console.log("<Map.onDrawStop> Создаём Area.");
1072
+ if (self.prev_mode === "edit_floor") {
1073
+ console.log("[Map.onDrawStop] Создаём Area.");
1061
1074
 
1062
1075
  //var bo = self.current_building.options;
1063
1076
  var fo = self.current_building.json_current_floor(); // когда нарисовали полигон Площади - определяем Этаж родитель
@@ -1067,8 +1080,8 @@ var InitMap = function (params) {
1067
1080
  _n_f.remove(); // удаляем нарисованный полигон, т.к. его уже заменили полигоном Area
1068
1081
  self.registerJustDrownArea(a);
1069
1082
  }
1070
- else if (self.prev_mode == 'editing') {
1071
- console.log("<Map.onDrawStop> Создаём Building.");
1083
+ else if (self.prev_mode === 'editing') {
1084
+ console.log("[Map.onDrawStop] Создаём Building.");
1072
1085
  var b = new Building();
1073
1086
  b.init({ coords:_n_f.params }, self);
1074
1087
  //b.is_new = true;
@@ -1102,12 +1115,13 @@ var InitMap = function (params) {
1102
1115
  self.registerDeletingArea = function(area) {
1103
1116
  var is_deleted = false;
1104
1117
 
1118
+ //noinspection EqualityComparisonWithCoercionJS
1105
1119
  if (utils.getById(area.id, self.areas_for_delete) == null) {
1106
- console.log('<registerDeletingArea> Регистрируем: area.id = ' + area.id);
1120
+ console.log('[registerDeletingArea] Регистрируем: area.id = ' + area.id);
1107
1121
  self.areas_for_delete.push(area);
1108
1122
  is_deleted = true;
1109
1123
  } else {
1110
- console.log('<registerDeletingArea> Убираем: area.id = ' + area.id);
1124
+ console.log('[registerDeletingArea] Убираем: area.id = ' + area.id);
1111
1125
  utils.deleteById(area.id, self.areas_for_delete);
1112
1126
  }
1113
1127
 
@@ -1166,7 +1180,7 @@ var InitMap = function (params) {
1166
1180
  * @returns {*}
1167
1181
  */
1168
1182
  self.normalizeScale = function (scale) {
1169
- console.log('<self.normalizeScale>' + self.o.fitscale);
1183
+ console.log('[self.normalizeScale]' + self.o.fitscale);
1170
1184
  if (scale < self.o.fitscale) scale = self.o.fitscale;
1171
1185
  else if (scale > self.o.maxscale) scale = self.o.maxscale;
1172
1186
 
@@ -1185,7 +1199,7 @@ var InitMap = function (params) {
1185
1199
  self.x = self.normalizeX(self.container.width() * 0.5 - self.scale * self.contentWidth * x);
1186
1200
  self.y = self.normalizeY(self.container.height() * ry - self.scale * self.contentHeight * y);
1187
1201
 
1188
- console.log("<Map.zoomTo> Call moveTo.");
1202
+ console.log("[Map.zoomTo] Call moveTo.");
1189
1203
  self.moveTo(self.x, self.y, self.scale, duration, easing);
1190
1204
  };*/
1191
1205
 
@@ -1216,6 +1230,7 @@ var InitMap = function (params) {
1216
1230
  var match_left = str.match(rx_left);
1217
1231
  var match_right = str.match(rx_top);
1218
1232
 
1233
+ //noinspection EqualityComparisonWithCoercionJS
1219
1234
  if (match_left != null && match_right != null) {
1220
1235
  var x = -1 * Number(match_left[1]); // ["left: -69.9985px;", "69.9985"]
1221
1236
  var y = -1 * Number(match_right[1]); // ["left: -69.9985px;", "69.9985"]
@@ -1240,7 +1255,7 @@ var InitMap = function (params) {
1240
1255
  * @private
1241
1256
  */
1242
1257
  var __moveToComplete = function (x,y,scale) {
1243
- //console.log("<__moveToComplete> x = " + x + "; y = " + y + "; scale = " + scale);
1258
+ //console.log("[__moveToComplete] x = " + x + "; y = " + y + "; scale = " + scale);
1244
1259
 
1245
1260
  /* NOTE:: CORE */
1246
1261
 
@@ -1286,20 +1301,21 @@ var InitMap = function (params) {
1286
1301
  self.__compose_css_style_for_map_object_image($( this ));
1287
1302
  });
1288
1303
 
1289
- //console.log("<__moveToStep> x = " + x + "; y = " + y + "; w = " + w + "; h = " + h + "; scale = " + scale_during_animation);
1304
+ //console.log("[__moveToStep] x = " + x + "; y = " + y + "; w = " + w + "; h = " + h + "; scale = " + scale_during_animation);
1290
1305
  };
1291
1306
 
1292
1307
  // x,y - экранные координаты
1293
1308
  // сюда подаётся scale, который нужно присвоить map после анимации
1294
1309
  self.moveTo = function (x, y, scale, d, easing) {
1295
- console.log("<self.moveTo> x = " + x + "; y = " + y + "; scale = " + scale + "; delay = " + d);
1296
- //console.log('<self.moveTo>');
1310
+ console.log("[self.moveTo] x = " + x + "; y = " + y + "; scale = " + scale + "; delay = " + d);
1311
+ //console.log('[self.moveTo]');
1297
1312
 
1298
1313
  // если подан аргумент scale(масштаб)
1299
1314
  // перемещаемся анимированно
1300
1315
  if (scale !== undefined) {
1301
1316
 
1302
1317
  // на время движения скрываем слой с полосатой анимацией
1318
+ //noinspection EqualityComparisonWithCoercionJS
1303
1319
  if (self.current_area != null) {
1304
1320
  $("#masked").addClass('hiddn');
1305
1321
  setTimeout(__moveToTimeout, d);
@@ -1346,6 +1362,7 @@ var InitMap = function (params) {
1346
1362
  //self.svg_overlay.attr('viewBox', t);
1347
1363
  }
1348
1364
 
1365
+ //noinspection EqualityComparisonWithCoercionJS
1349
1366
  if (self.current_area != null) {
1350
1367
  self.current_area.invalidateAnimationMask();
1351
1368
  }
@@ -1380,7 +1397,7 @@ var InitMap = function (params) {
1380
1397
  // извлекаем значения
1381
1398
  var area_id = $s.val();
1382
1399
  var apolygon_id = self.current_area.id;
1383
- console.log("<Map.link_area> Связать Площадь area_id = " + area_id + " c полигоном apolygon_id = " + apolygon_id);
1400
+ console.log("[Map.link_area] Связать Площадь area_id = " + area_id + " c полигоном apolygon_id = " + apolygon_id);
1384
1401
 
1385
1402
  // нажимаем кнопку "закрыть"
1386
1403
  $b.click();
@@ -1416,7 +1433,7 @@ var InitMap = function (params) {
1416
1433
  // извлекаем значения
1417
1434
  var sfloor_id = $s.val(); // id Этажа
1418
1435
  var current_floor_id = self.current_building.json_current_floor()["id"]; // id Картинки Этажа (связываем Этаж с картинкой)
1419
- console.log('<link_floor> Связать Этаж sfloor_id=' + sfloor_id + ' с Картинкой Этажа current_floor_id=' + current_floor_id + '.');
1436
+ console.log('[link_floor] Связать Этаж sfloor_id=' + sfloor_id + ' с Картинкой Этажа current_floor_id=' + current_floor_id + '.');
1420
1437
 
1421
1438
  // нажимаем кнопку "закрыть"
1422
1439
  $b.click();
@@ -1444,7 +1461,7 @@ var InitMap = function (params) {
1444
1461
  // взять C80MapFloors::current_building и назначить ему Rent::building.id,
1445
1462
  // выбранный в окне _modal_window.html.erb
1446
1463
  self.link_building = function () {
1447
- //console.log('<Map.link_building> ');
1464
+ //console.log('[Map.link_building] ');
1448
1465
 
1449
1466
  // фиксируем компоненты модального окна
1450
1467
  var $m = $('#modal_window');
@@ -1454,7 +1471,7 @@ var InitMap = function (params) {
1454
1471
  // извлекаем значения
1455
1472
  var building_id = $s.val();
1456
1473
  var map_building_id = self.current_building["id"]; //#-> [iddqd]
1457
- console.log("<Map.link_area> building_id = " + building_id + "; map_building_id = " + map_building_id);
1474
+ console.log("[Map.link_area] building_id = " + building_id + "; map_building_id = " + map_building_id);
1458
1475
 
1459
1476
  // нажимаем кнопку "закрыть"
1460
1477
  $b.click();
@@ -1500,13 +1517,16 @@ var InitMap = function (params) {
1500
1517
  var l = c.length;
1501
1518
  var i, ig;
1502
1519
 
1503
- console.log('<admin_label_show_all> Показать все админские лейблы полигонов в кол-ве ' + l + ' шт.');
1520
+ console.log('[admin_label_show_all] Показать все админские лейблы полигонов в кол-ве ' + l + ' шт.');
1504
1521
 
1505
1522
  for (i=0; i<l; i++) {
1506
1523
  ig = s[0].children[i]; // именно [0]
1507
1524
  //console.log(ig['obj']); // => Polygon
1525
+ //noinspection EqualityComparisonWithCoercionJS
1508
1526
  if (ig != undefined) { // такое тоже бывает
1527
+ //noinspection EqualityComparisonWithCoercionJS
1509
1528
  if (ig['obj'] != undefined) { //
1529
+ //noinspection EqualityComparisonWithCoercionJS
1510
1530
  if (ig['obj']['building'] != undefined) { // добираемся до класса Building.js
1511
1531
  ig['obj']['building'].admin_label_show(); // показываем админский лейбл
1512
1532
  }
@@ -1525,13 +1545,16 @@ var InitMap = function (params) {
1525
1545
  var l = c.length;
1526
1546
  var i, ig;
1527
1547
 
1528
- console.log('<admin_label_hide_all> Скрыть все админские лейблы полигонов в кол-ве ' + l + ' шт.');
1548
+ console.log('[admin_label_hide_all] Скрыть все админские лейблы полигонов в кол-ве ' + l + ' шт.');
1529
1549
 
1530
1550
  for (i=0; i<l; i++) {
1531
1551
  ig = s[0].children[i]; // именно [0]
1532
1552
  //console.log(ig['obj']); // => Polygon
1553
+ //noinspection EqualityComparisonWithCoercionJS
1533
1554
  if (ig != undefined) { // такое тоже бывает
1555
+ //noinspection EqualityComparisonWithCoercionJS
1534
1556
  if (ig['obj'] != undefined) { //
1557
+ //noinspection EqualityComparisonWithCoercionJS
1535
1558
  if (ig['obj']['building'] != undefined) { // добираемся до класса Building.js
1536
1559
  ig['obj']['building'].admin_label_hide(); // скрываем админский лейбл
1537
1560
  }
@@ -111,8 +111,9 @@ function SearchGUI(link_to_map) {
111
111
  _$container.data('init_position_top', _$container.css("top"));
112
112
  _$container.data('init_position_left', _$container.css("left"));
113
113
  }
114
- _$container.css("top", _$container.data('init_position_top'));
115
- _$container.css("left", _$container.data('init_position_left'));
114
+ // _$container.css("top", _$container.data('init_position_top'));
115
+ // _$container.css("left", _$container.data('init_position_left'));
116
+ _$container.removeClass('hdn');
116
117
  }
117
118
  };
118
119
 
@@ -123,8 +124,9 @@ function SearchGUI(link_to_map) {
123
124
  this.position_inside = function () {
124
125
  //console.log('<position_inside> [breakpoint].');
125
126
  if (_$container != null) { // может быть null, если вдруг gui поиска не пришёл с сервера
126
- _$container.css("left", -200);
127
- _$container.css("top", _$container.data('init_position_top'));
127
+ // _$container.css("left", -200);
128
+ // _$container.css("top", _$container.data('init_position_top'));
129
+ _$container.addClass('hdn');
128
130
  }
129
131
  };
130
132
 
@@ -4,9 +4,18 @@ div.container#search_container {
4
4
  height: 0;
5
5
  z-index: 5;
6
6
 
7
- -webkit-transition: left .8s cubic-bezier(.25, .8, .25, 1), top .8s cubic-bezier(.25, .8, .25, 1);
8
- -moz-transition: left .8s cubic-bezier(.25, .8, .25, 1), top .8s cubic-bezier(.25, .8, .25, 1);
9
- transition: left .8s cubic-bezier(.25, .8, .25, 1), top .8s cubic-bezier(.25, .8, .25, 1);
7
+ //-webkit-transition: left .8s cubic-bezier(.25, .8, .25, 1), top .8s cubic-bezier(.25, .8, .25, 1);
8
+ //-moz-transition: left .8s cubic-bezier(.25, .8, .25, 1), top .8s cubic-bezier(.25, .8, .25, 1);
9
+ //transition: left .8s cubic-bezier(.25, .8, .25, 1), top .8s cubic-bezier(.25, .8, .25, 1);
10
+
11
+ visibility: visible;
12
+ opacity: 1;
13
+ transition: visibility 0.2s, opacity 0.2s linear;
14
+
15
+ &.hdn {
16
+ visibility: hidden;
17
+ opacity: 0;
18
+ }
10
19
 
11
20
  div#search_gui {
12
21
  display: block;
@@ -1,3 +1,3 @@
1
1
  module C80MapFloors
2
- VERSION = '0.2.0.1'
2
+ VERSION = '0.2.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c80_map_floors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.1
4
+ version: 0.2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A