Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alukach committed Oct 26, 2015
1 parent 3dcf162 commit a44b803
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
15 changes: 7 additions & 8 deletions src/js/menus.layer-context-menu.dropchop.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ var dropchop = (function(dc) {
var geoContainer = $('<div>').addClass('operations-geo');
dc.$elem.append(geoContainer);

// wire up signal handlers
// $(dc).on('layer:selected', dc.menus.layerContextMenu.geoCheck);
// $(dc).on('layer:unselected', dc.menus.layerContextMenu.geoCheck);
// $(dc).on('operation:geo', dc.menus.layerContextMenu.geoExecute);

// Bind the context-menu handler on any item added to layerlist
$(dc).on('layerlist:added', function(e, layer){
$(layer).bind("contextmenu", function(e) {
Expand Down Expand Up @@ -47,7 +42,7 @@ var dropchop = (function(dc) {

e.preventDefault();
});
})
});

// Remove open menus
$('html').bind('click', function (e) {
Expand Down Expand Up @@ -79,11 +74,14 @@ var dropchop = (function(dc) {
'remove': dc.ops.file['remove'],

/* jshint ignore:end */
}
};
};

/* jshint ignore:start */
/* ignoring these functions in jshint because we are getting
an unecessary strict violation warning, but our usage of `this`
is proper here. */
function _handleBtnClick(event) {
console.log(event);
event.preventDefault();
var operation = $(this).attr('data-operation');
console.log(operation);
Expand All @@ -94,6 +92,7 @@ var dropchop = (function(dc) {
throw err;
}
};
/* jshint ignore:end */

return dc;

Expand Down
10 changes: 3 additions & 7 deletions src/js/menus.left.dropchop.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ var dropchop = (function(dc) {
dc.menus.left = dc.menus.left || {};

dc.menus.left.init = function() {
// build ops.geo container
var geoContainer = $('<div>').addClass('operations-geo');
dc.$elem.append(geoContainer);

// wire up signal handlers
$(dc).on('operation:file:load-gist', dc.ops.file['load-gist'].get);
$(dc).on('operation:file:load-url', dc.ops.file['load-url'].get);
$(dc).on('operation:file:load-overpass', dc.ops.file['load-overpass'].get);
$(dc).on('operation:file:rename', dc.ops.file.rename.callback);

dc.ops.setup = [
dc.menus.left.setup = [
{
name: 'import',
icon: '<i class="fa fa-plus"></i>',
Expand Down Expand Up @@ -53,7 +49,7 @@ var dropchop = (function(dc) {

// setup ops file
var leftMenu = $('<div>').addClass('dropchop-menu-left');
var setup = dc.ops.setup;
var setup = dc.menus.left.setup;

for (var i = 0; i < setup.length; i++) {
var action = setup[i];
Expand All @@ -78,7 +74,7 @@ var dropchop = (function(dc) {
// loop through each action and build a button for it, just like above,
// but append it to the menu-collapse-inner element
for (var a = 0; a < setup[i].actions.length; a++) {
var actn = dc.ops.setup[i].actions[a];
var actn = setup[i].actions[a];
collapseInner.append(buildMenuButton(actn));
}
collapseBtn.append(collapseInner);
Expand Down

0 comments on commit a44b803

Please sign in to comment.