Skip to content

Commit

Permalink
#25 handle clear button
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuque committed Feb 3, 2014
1 parent 905bab7 commit 1e19616
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
22 changes: 18 additions & 4 deletions inner/js/ui/edit-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ if (!window.mobmap) { window.mobmap={}; }
if (!editbuttonsSpriteManager) {
editbuttonsSpriteManager = new mobmap.ToolButtonSpriteManager('images/editbuttons-combined.png');
}


this.ownerApp = null;

this.element = document.createElement("table");
this.tableRow = document.createElement("tr");
this.element.appendChild(this.tableRow);
Expand All @@ -19,6 +21,10 @@ if (!window.mobmap) { window.mobmap={}; }
}

MobmapEditToolBar.prototype = {
setApp: function(a) {
this.ownerApp = a;
},

addPresetColumns: function() {
var list = [
// Internal name | Label text
Expand Down Expand Up @@ -75,12 +81,20 @@ if (!window.mobmap) { window.mobmap={}; }

// Handling

onSelectionButtonClick: function(e, btnObj) {
console.log(e, btnObj);
onSelectionButtonClick: function(btnObj, e) {
switch(btnObj.name) {
case 'sel_clear': this.onSelectionClearButtonClick(); break;
}
},

onSelectionButtonMousedown: function(e, btnObj) {
onSelectionButtonMousedown: function(btnObj, e) {
console.log(e, btnObj);
},

onSelectionClearButtonClick: function() {
if (this.ownerApp) {
console.log("Call sel clear", this.ownerApp);
}
}
};

Expand Down
1 change: 1 addition & 0 deletions inner/js/ui/tool-pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if (!window.mobmap) { window.mobmap={}; }
setApp: function(a) {
this.ownerApp = a;
this.controlPanel.setApp(a);
this.editToolBar.setApp(a);
},

observeContainerEvents: function(app3PanesView) {
Expand Down

0 comments on commit 1e19616

Please sign in to comment.