Skip to content
Snippets Groups Projects
Commit fdd4a23d authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

unbind events

parent dfbb4b83
No related branches found
No related tags found
No related merge requests found
......@@ -285,7 +285,7 @@ input.intInput, input.floatInput{
#navRibbon{
height: 49px;
width: 270px;
width: 400px;
z-index: 1;
display: block;
position: absolute;
......
......@@ -33,6 +33,11 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
_finishComposite: function(e){
e.preventDefault();
this.stopListening();
if (!lattice.makeNewCompositeMaterial){
console.warn("lattice not in composite mode for finish composite call");
this._exit();
return;
}
lattice.makeNewCompositeMaterial($("#compositeName").val());
this._exit();
},
......@@ -48,6 +53,11 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
_deleteComposite: function(e){
e.preventDefault();
if (!lattice.deleteComposite){
console.warn("lattice not in composite mode for delete composite call");
this._exit();
return;
}
lattice.deleteComposite();
this._exit();
},
......@@ -57,7 +67,6 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
},
_makeTemplateJSON: function(){
console.log("render");
return _.extend(lattice.toJSON());
},
......@@ -69,9 +78,9 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
Display Color:   \
<input style="border-color: <%= compositeColor %> ;" value="<%= compositeColor %>" placeholder="Enter HEX" class="halfWidth form-control" type="text"><br/><br/>\
<a id="newRandomColor" href="#" class="btn btn-block btn-lg btn-default">New Random Color</a><br/><br/>\
<a id="cancelComposite" href="#" class="btn btn-halfWidth btn-lg btn-default">Cancel / Exit</a>\
<a id="deleteComposite" href="#" class="btn btn-halfWidth pull-right btn-lg btn-default"><span class="fui-trash"></span> Delete</a><br/><br/>\
<a id="finishComposite" href="#" class="btn btn-block btn-lg btn-success">Finish Composite</a><br/>\
<a id="cancelComposite" href="#" class="btn btn-halfWidth btn-lg btn-default">Cancel / Exit</a>\
<a id="deleteComposite" href="#" class="btn btn-halfWidth pull-right btn-lg btn-default"><span class="fui-trash"></span> Delete</a><br/>\
')
});
......
......@@ -25,9 +25,9 @@ define(['jquery', 'underscore', 'backbone'], function($, _, Backbone){
destroy: function(){
this.stopListening();
// this.undelegateEvents();
// this.$el.removeData().unbind();
// this.remove();
this.undelegateEvents();
this.$el.removeData().unbind();
// this.remove();//todo not convinced I have this right yet
// Backbone.View.prototype.remove.call(this);
}
......
......@@ -61,10 +61,12 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice'], function($, _,
template: _.template('\
<div class="btn-toolbar">\
<div class="btn-group">\
<!--<a data-type="supercell" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "supercell"){ %> ribbon-selected<% } %>" href="#">Super</a>-->\
<a data-type="cell" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "cell"){ %> ribbon-selected<% } %>" href="#"><img data-type="cell" src="assets/imgs/cell-sm.png"></a>\
<% if (allPartTypes[cellType][connectionType]){ %>\
<a data-type="part" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "part"){ %> ribbon-selected<% } %>" href="#"><img data-type="part" src="assets/imgs/part-sm.png"></a>\
<% } %>\
<!--<a data-type="beam" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "beam"){ %> ribbon-selected<% } %>" href="#">Beam</a>-->\
<a class="btn btn-primary btn-ribbon ribbonDeleteMode<% if (deleteMode){ %> ribbon-selected"<% } %>"><span class="fui-cross"></span></a>\
</div>\
</div>\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment