- Timestamp:
- 2019-02-12T12:44:28+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/map-scripts-editor.js
r32766 r32769 176 176 if (resizable) { 177 177 if(dontResize == false){ 178 historyOverlayPush();178 mapEditorHistory.historyOverlayPush(); 179 179 } 180 180 … … 187 187 188 188 if (selectedShapes.length > 0) { 189 historyOverlayPush();189 mapEditorHistory.historyOverlayPush(); 190 190 } 191 191 } … … 193 193 function shapeSpecsChangeMU() { 194 194 if (selectedShapes.length > 0) { 195 presentOverlayPush();195 mapEditorHistory.presentOverlayPush (); 196 196 } 197 197 } … … 309 309 google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) { 310 310 allowDeselect = true; 311 historyOverlayPush();311 mapEditorHistory.historyOverlayPush(); 312 312 overlays.push(e.overlay); // store reference to added overlay 313 313 var newShape = e.overlay; 314 314 newShape.type = e.type; 315 presentOverlayPush();315 mapEditorHistory.presentOverlayPush(); 316 316 317 317 if (e.type !== google.maps.drawing.OverlayType.MARKER) { … … 348 348 document.addEventListener('keydown', function () { 349 349 if (event.code == 'KeyY' && (event.ctrlKey || event.metaKey) || (event.code == 'KeyZ' && event.code == 'ShiftLeft' && (event.ctrlKey || event.metaKey))) { 350 redo();350 mapEditorHistory.redo(); 351 351 } 352 352 if (event.code == 'KeyZ' && (event.ctrlKey || event.metaKey)) { 353 353 if (shiftKeyPressed == false) { 354 undo(); 355 mapEditorHistory.undo(overlays); // ***** when we only have MapEditorHistory as a class 354 //undo(); 355 mapEditorHistory.undo(); 356 //mapEditorHistory.undo(overlays, draggableState); // ***** when we only have MapEditorHistory as a class 356 357 //that.mapEditorHistory.undo(that.overlays); // ***** when we have both MapEditorHistory and MapEditor as classes 357 358 … … 436 437 google.maps.event.addListener(newShape, 'dragstart', function (e) { 437 438 beingDragged = true; 438 historyOverlayPush();439 mapEditorHistory.historyOverlayPush(); 439 440 440 441 }); … … 442 443 google.maps.event.addListener(newShape, 'dragend', function () { 443 444 beingDragged = false; 444 presentOverlayPush();445 mapEditorHistory.presentOverlayPush (); 445 446 allowDeselect = false; 446 447 }); … … 458 459 google.maps.event.addListener(newShape, 'dragstart', function (e) { 459 460 allowDeselect = false; 460 historyOverlayPush();461 mapEditorHistory.historyOverlayPush(); 461 462 }); 462 463 … … 465 466 google.maps.event.addListener(newShape, 'dragend', function () { 466 467 beingDragged = false; 467 presentOverlayPush();468 mapEditorHistory.presentOverlayPush (); 468 469 settingThePath(); 469 470 … … 475 476 google.maps.event.addListener(newShape, 'bounds_changed', function (e) { 476 477 if (beingDragged == false) { 477 presentOverlayPush();478 mapEditorHistory.presentOverlayPush (); 478 479 } 479 480 }); … … 485 486 } 486 487 if (e.vertex !== undefined || e.edge !== undefined) { 487 historyOverlayPush()488 mapEditorHistory.historyOverlayPush() 488 489 } 489 490 if (drawingManager.drawingMode == null) { … … 494 495 google.maps.event.addListener(newShape, 'mouseup', function (e) { 495 496 if (e.vertex !== undefined || e.edge !== undefined) { 496 presentOverlayPush()497 mapEditorHistory.presentOverlayPush () 497 498 } else { 498 499 //setSelection(newShape, e); … … 572 573 function setSelectedThickness(sWeight) { 573 574 if (selectedShapes.length > 0) { 574 // historyOverlayPush();575 //mapEditorHistory.historyOverlayPush(); 575 576 for (var i = 0; i < selectedShapes.length; i++) { 576 577 selectedShapes[i].set('strokeWeight', sWeight); … … 636 637 637 638 function printHistory() { 638 console.log("prev", prevOverlays);639 console.log("present ", presentOverlays);640 console.log("undone ", undoneOverlays);639 console.log("prev", mapEditorHistory.prevOverlays); 640 console.log("present ", mapEditorHistory.presentOverlays); 641 console.log("undone ", mapEditorHistory.undoneOverlays); 641 642 console.log(mouseState); 642 643 } … … 668 669 function deleteSelectedShape() { 669 670 //console.log("this fires"); 670 historyOverlayPush();671 mapEditorHistory.historyOverlayPush(); 671 672 for (var i = 0; i < selectedShapes.length; i++) { 672 673 selectedShapes[i].setMap(null); … … 680 681 selectedShapes = []; 681 682 //console.log("this fires"); 682 presentOverlayPush();683 mapEditorHistory.presentOverlayPush (); 683 684 } 684 685 … … 686 687 console.log(nId); 687 688 //console.log("this fires"); 688 historyOverlayPush();689 mapEditorHistory.historyOverlayPush(); 689 690 for (var i = 0; i < overlays.length; i++) { 690 691 overlays[i].setMap(null); … … 692 693 overlays = []; 693 694 //console.log("this fires"); 694 presentOverlayPush();695 } 695 mapEditorHistory.presentOverlayPush (); 696 }
Note:
See TracChangeset
for help on using the changeset viewer.