Example #1
0
 initialize: function(options) {
     if (!options.selectionInterface) {
         throw 'Selection interface has not been provided';
     }
     this.listenTo(store.get('content'), 'change:drawing', this.handleDrawing);
     this.handleDrawing();
 },
Example #2
0
 initialize: function(){
     this.listenTo(store.get('workspaces'), 'change:saved update add remove', this.handleSaved);
     this.listenTo(sources, 'all', this.handleSources);
     this.handleSaved();
     this.handleSources();
     this.handleLogo();
 },
Example #3
0
 updateMap: function() {
   if (!this.isDestroyed) {
     var mode = this.model.get('mode')
     if (mode !== undefined && store.get('content').get('drawing') !== true) {
       wreqr.vent.trigger('search:' + mode + 'display', this.model)
     }
   }
 },
Example #4
0
 initialize: function(options) {
   if (!options.selectionInterface) {
     throw 'Selection interface has not been provided'
   }
   this.mapModel = new MapModel()
   this.listenTo(store.get('content'), 'change:drawing', this.handleDrawing)
   this.handleDrawing()
   this.setupMouseLeave()
 },
 onMapLeftClick: function(event, mapEvent) {
     if (mapEvent.mapTarget && mapEvent.mapTarget !== 'userDrawing' && !store.get('content').get('drawing')) {
         if (event.shiftKey) {
             this.handleShiftClick(mapEvent.mapTarget);
         } else if (event.ctrlKey || event.metaKey) {
             this.handleCtrlClick(mapEvent.mapTarget);
         } else {
             this.handleClick(mapEvent.mapTarget);
         }
     }
 },
 function(confirmation) {
   var choice = confirmation.get('choice')
   if (choice === true) {
     var loadingview = new LoadingView()
     store
       .get('workspaces')
       .once('sync', function(workspace, resp, options) {
         loadingview.remove()
         wreqr.vent.trigger('router:navigate', {
           fragment: 'workspaces/' + workspace.id,
           options: {
             trigger: true,
           },
         })
       })
     store.get('workspaces').createWorkspaceWithQuery(newQuery)
   } else if (choice !== false) {
     store.getCurrentQueries().remove(choice)
     store.getCurrentQueries().add(newQuery)
     store.setCurrentQuery(newQuery)
   }
 }.bind(this)
Example #7
0
 refreshResult: function(result) {
     var id = result.get('metacard').id;
     result.refreshData();
     store.get('workspaces').forEach(function(workspace) {
         workspace.get('queries').forEach(function(query) {
             if (query.get('result')) {
                 query.get('result').get('results').forEach(function(result) {
                     if (result.get('metacard').get('properties').get('id') === id) {
                         result.refreshData();
                     }
                 });
             }
         });
     });
     alert.get('currentResult').get('results').forEach(function(result) {
         if (result.get('metacard').get('properties').get('id') === id) {
             result.refreshData();
         }
     });
 }
Example #8
0
 handleDrawing: function() {
     this.$el.toggleClass('is-drawing', store.get('content').get('drawing'));
 },
Example #9
0
 viewer.screenSpaceEventHandler.setInputAction(function() {
     if (!store.get('content').get('drawing')){
          $('body').mousedown();
     }
 }, Cesium.ScreenSpaceEventType.RIGHT_DOWN);
Example #10
0
 handleSaved: function() {
   var hasUnsaved = store.get('workspaces').find(function(workspace) {
     return !workspace.isSaved()
   })
   this.$el.toggleClass('is-saved', !hasUnsaved)
 },
Example #11
0
 handleSaved: function(){
     var hasUnsaved = store.get('workspaces').some(function(workspace){
         return !workspace.isSaved();
     });
     this.$el.toggleClass('has-unsaved', hasUnsaved);
 },