1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/63002499f23e/ Changeset: 63002499f23e User: guerler Date: 2015-02-12 03:41:03+00:00 Summary: Ui: Drilldown fix state expansion Affected #: 3 files diff -r 7793da905716b1a7fc4ff863ea2e0663904df01c -r 63002499f23ea119d19f070876cc1b0a564cb757 client/galaxy/scripts/mvc/ui/ui-drilldown.js --- a/client/galaxy/scripts/mvc/ui/ui-drilldown.js +++ b/client/galaxy/scripts/mvc/ui/ui-drilldown.js @@ -23,9 +23,9 @@ values = [values]; } for (var i in values) { - var list = this.header_index[values[i]] + var list = this.header_index[values[i]]; for (var j in list) { - this._setState(list[i], true); + this._setState(list[j], true); } } } @@ -80,6 +80,9 @@ // copy current header list var new_header = header.slice(0); + // keep track of header list + self.header_index[level.value] = new_header.slice(0); + // build template var $group = $('<div/>'); if (has_options) { @@ -101,18 +104,12 @@ $group.append($buttongroup); iterate($subgroup, level.options, new_header); $group.append($subgroup); - - // keep track of header list - self.header_index[level.value] = new_header; } else { // append child options $group.append(self._templateOption({ label: level.name, value: level.value })); - - // keep track of header list - self.header_index[level.value] = new_header; } $tmpl.append($group); } diff -r 7793da905716b1a7fc4ff863ea2e0663904df01c -r 63002499f23ea119d19f070876cc1b0a564cb757 static/scripts/mvc/ui/ui-drilldown.js --- a/static/scripts/mvc/ui/ui-drilldown.js +++ b/static/scripts/mvc/ui/ui-drilldown.js @@ -23,9 +23,9 @@ values = [values]; } for (var i in values) { - var list = this.header_index[values[i]] + var list = this.header_index[values[i]]; for (var j in list) { - this._setState(list[i], true); + this._setState(list[j], true); } } } @@ -80,6 +80,9 @@ // copy current header list var new_header = header.slice(0); + // keep track of header list + self.header_index[level.value] = new_header.slice(0); + // build template var $group = $('<div/>'); if (has_options) { @@ -101,18 +104,12 @@ $group.append($buttongroup); iterate($subgroup, level.options, new_header); $group.append($subgroup); - - // keep track of header list - self.header_index[level.value] = new_header; } else { // append child options $group.append(self._templateOption({ label: level.name, value: level.value })); - - // keep track of header list - self.header_index[level.value] = new_header; } $tmpl.append($group); } diff -r 7793da905716b1a7fc4ff863ea2e0663904df01c -r 63002499f23ea119d19f070876cc1b0a564cb757 static/scripts/packed/mvc/ui/ui-drilldown.js --- a/static/scripts/packed/mvc/ui/ui-drilldown.js +++ b/static/scripts/packed/mvc/ui/ui-drilldown.js @@ -1,1 +1,1 @@ -define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.BaseIcons.extend({initialize:function(d){d.type=d.display||"checkbox";d.multiple=(d.display=="checkbox");a.BaseIcons.prototype.initialize.call(this,d);this.initial=true},value:function(d){var k=a.BaseIcons.prototype.value.call(this,d);if(this.initial&&k!==null&&this.header_index){this.initial=false;var e=k;if(!$.isArray(e)){e=[e]}for(var g in e){var h=this.header_index[e[g]];for(var f in h){this._setState(h[g],true)}}}return k},_setState:function(d,e){var f=this.$("#button-"+d);var g=this.$("#subgroup-"+d);f.data("is_expanded",e);if(e){g.fadeIn("fast");f.removeClass("toggle-expand");f.addClass("toggle")}else{g.hide();f.removeClass("toggle");f.addClass("toggle-expand")}},_templateOptions:function(g){var f=this;this.header_index={};this.header_list=[];function e(k,i){var l=k.find("#button-"+i);l.on("click",function(){f._setState(i,!l.data("is_expanded"))})}function d(r,t,o){o=o||[];for(h in t){var k=t[h];var l=k.options.length>0;var q=o.slice(0);var s=$("<div/>");if(l){var n=b.uuid();var i=$('<span id="button-'+n+'" class="ui-drilldown-button form-toggle icon-button toggle-expand"/>');var m=$('<div id="subgroup-'+n+'" style="display: none; margin-left: 25px;"/>');q.push(n);var p=$("<div/>");p.append(i);p.append(f._templateOption({label:k.name,value:k.value}));s.append(p);d(m,k.options,q);s.append(m);f.header_index[k.value]=q}else{s.append(f._templateOption({label:k.name,value:k.value}));f.header_index[k.value]=q}r.append(s)}}var j=$("<div/>");d(j,g);for(var h in this.header_index){this.header_list=_.uniq(this.header_list.concat(this.header_index[h]))}for(var h in this.header_list){e(j,this.header_list[h])}return j},_template:function(d){return'<div class="ui-options-list drilldown-container" id="'+d.id+'"/>'}});return{View:c}}); \ No newline at end of file +define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.BaseIcons.extend({initialize:function(d){d.type=d.display||"checkbox";d.multiple=(d.display=="checkbox");a.BaseIcons.prototype.initialize.call(this,d);this.initial=true},value:function(d){var k=a.BaseIcons.prototype.value.call(this,d);if(this.initial&&k!==null&&this.header_index){this.initial=false;var e=k;if(!$.isArray(e)){e=[e]}for(var g in e){var h=this.header_index[e[g]];for(var f in h){this._setState(h[f],true)}}}return k},_setState:function(d,e){var f=this.$("#button-"+d);var g=this.$("#subgroup-"+d);f.data("is_expanded",e);if(e){g.fadeIn("fast");f.removeClass("toggle-expand");f.addClass("toggle")}else{g.hide();f.removeClass("toggle");f.addClass("toggle-expand")}},_templateOptions:function(g){var f=this;this.header_index={};this.header_list=[];function e(k,i){var l=k.find("#button-"+i);l.on("click",function(){f._setState(i,!l.data("is_expanded"))})}function d(r,t,o){o=o||[];for(h in t){var k=t[h];var l=k.options.length>0;var q=o.slice(0);f.header_index[k.value]=q.slice(0);var s=$("<div/>");if(l){var n=b.uuid();var i=$('<span id="button-'+n+'" class="ui-drilldown-button form-toggle icon-button toggle-expand"/>');var m=$('<div id="subgroup-'+n+'" style="display: none; margin-left: 25px;"/>');q.push(n);var p=$("<div/>");p.append(i);p.append(f._templateOption({label:k.name,value:k.value}));s.append(p);d(m,k.options,q);s.append(m)}else{s.append(f._templateOption({label:k.name,value:k.value}))}r.append(s)}}var j=$("<div/>");d(j,g);for(var h in this.header_index){this.header_list=_.uniq(this.header_list.concat(this.header_index[h]))}for(var h in this.header_list){e(j,this.header_list[h])}return j},_template:function(d){return'<div class="ui-options-list drilldown-container" id="'+d.id+'"/>'}});return{View:c}}); \ No newline at end of file Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.