1
0
Fork 0

Fixed a bug with two identically named check boxes and click events that were not correctly unbound

This commit is contained in:
Michael Hackstein 2014-11-28 17:06:31 +01:00
parent 288f174011
commit fd8e3783c9
4 changed files with 22 additions and 21 deletions

View File

@ -41,7 +41,7 @@
<li><a href="#">
<label class="checkbox checkboxLabel">
<input class="css-checkbox" type="checkbox" id="checkSystem">
<input class="css-checkbox checkSystem" type="checkbox">
<label class="css-label"></label>System applications
</label>
</a></li>

View File

@ -28,8 +28,8 @@
<li class="nav-header">Type</li>
<li><a>
<label class="checkbox checkboxLabel">
<input class="css-checkbox" type="checkbox" id="checkSystem">
<label class="css-label" id="checkSystem"></label>System
<input class="css-checkbox checkSystemCollections" type="checkbox">
<label class="css-label"></label>System
</label>
</a></li>

View File

@ -10,7 +10,7 @@ window.ApplicationsView = Backbone.View.extend({
events: {
"click #checkDevel" : "toggleDevel",
"click #checkActive" : "toggleActive",
"click #checkSystem" : "toggleSystem",
"click .checkSystem" : "toggleSystem",
"click #foxxToggle" : "slideToggle",
"click #importFoxxToggle" : "slideToggleImport",
"change #importFoxx" : "uploadSetup",
@ -189,6 +189,7 @@ window.ApplicationsView = Backbone.View.extend({
},
toggleSystem: function() {
console.log("Toggle");
this._showSystem = !this._showSystem;
var self = this;
_.each(this._installedSubViews, function(v) {
@ -285,7 +286,7 @@ window.ApplicationsView = Backbone.View.extend({
this.delegateEvents();
$('#checkActive').attr('checked', this._showActive);
$('#checkDevel').attr('checked', this._showDevel);
$('#checkSystem').attr('checked', this._showSystem);
$('.checkSystem').attr('checked', this._showSystem);
var self = this;
_.each(this._installedSubViews, function(v) {

View File

@ -63,20 +63,20 @@
},
events: {
"click #createCollection" : "createCollection",
"keydown #searchInput" : "restrictToSearchPhraseKey",
"change #searchInput" : "restrictToSearchPhrase",
"click #searchSubmit" : "restrictToSearchPhrase",
"click #checkSystem" : "checkSystem",
"click #checkLoaded" : "checkLoaded",
"click #checkUnloaded" : "checkUnloaded",
"click #checkDocument" : "checkDocument",
"click #checkEdge" : "checkEdge",
"click #sortName" : "sortName",
"click #sortType" : "sortType",
"click #sortOrder" : "sortOrder",
"click #collectionsToggle" : "toggleView",
"click .css-label" : "checkBoxes"
"click #createCollection" : "createCollection",
"keydown #searchInput" : "restrictToSearchPhraseKey",
"change #searchInput" : "restrictToSearchPhrase",
"click #searchSubmit" : "restrictToSearchPhrase",
"click .checkSystemCollections" : "checkSystem",
"click #checkLoaded" : "checkLoaded",
"click #checkUnloaded" : "checkUnloaded",
"click #checkDocument" : "checkDocument",
"click #checkEdge" : "checkEdge",
"click #sortName" : "sortName",
"click #sortType" : "sortType",
"click #sortOrder" : "sortOrder",
"click #collectionsToggle" : "toggleView",
"click .css-label" : "checkBoxes"
},
updateCollectionsView: function() {
@ -104,7 +104,7 @@
var searchOptions = this.collection.searchOptions;
var oldValue = searchOptions.includeSystem;
searchOptions.includeSystem = ($('#checkSystem').is(":checked") === true);
searchOptions.includeSystem = ($('.checkSystemCollections').is(":checked") === true);
if (oldValue !== searchOptions.includeSystem) {
this.render();
@ -182,7 +182,7 @@
var searchOptions = this.collection.searchOptions;
$('#checkLoaded').attr('checked', searchOptions.includeLoaded);
$('#checkUnloaded').attr('checked', searchOptions.includeUnloaded);
$('#checkSystem').attr('checked', searchOptions.includeSystem);
$('.checkSystemCollections').attr('checked', searchOptions.includeSystem);
$('#checkEdge').attr('checked', searchOptions.includeEdge);
$('#checkDocument').attr('checked', searchOptions.includeDocument);
$('#sortName').attr('checked', searchOptions.sortBy !== 'type');