1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/7793da905716/ Changeset: 7793da905716 User: guerler Date: 2015-02-12 03:04:53+00:00 Summary: Ui: Drilldown simplify state expansion Affected #: 3 files diff -r 1fbbe30e7b311b27b351f0964517bfeeb7500290 -r 7793da905716b1a7fc4ff863ea2e0663904df01c 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 @@ -22,16 +22,12 @@ if (!$.isArray(values)) { values = [values]; } - var headers_merged = []; for (var i in values) { var list = this.header_index[values[i]] - if (list) { - headers_merged = _.uniq(headers_merged.concat(list)); + for (var j in list) { + this._setState(list[i], true); } } - for (var i in headers_merged) { - this._setState(headers_merged[i], true); - } } return val; }, diff -r 1fbbe30e7b311b27b351f0964517bfeeb7500290 -r 7793da905716b1a7fc4ff863ea2e0663904df01c static/scripts/mvc/ui/ui-drilldown.js --- a/static/scripts/mvc/ui/ui-drilldown.js +++ b/static/scripts/mvc/ui/ui-drilldown.js @@ -22,16 +22,12 @@ if (!$.isArray(values)) { values = [values]; } - var headers_merged = []; for (var i in values) { var list = this.header_index[values[i]] - if (list) { - headers_merged = _.uniq(headers_merged.concat(list)); + for (var j in list) { + this._setState(list[i], true); } } - for (var i in headers_merged) { - this._setState(headers_merged[i], true); - } } return val; }, diff -r 1fbbe30e7b311b27b351f0964517bfeeb7500290 -r 7793da905716b1a7fc4ff863ea2e0663904df01c 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 j=a.BaseIcons.prototype.value.call(this,d);if(this.initial&&j!==null&&this.header_index){this.initial=false;var e=j;if(!$.isArray(e)){e=[e]}var h=[];for(var f in e){var g=this.header_index[e[f]];if(g){h=_.uniq(h.concat(g))}}for(var f in h){this._setState(h[f],true)}}return j},_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[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 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.