Skip to content

Commit

Permalink
Fixed issue daylightstudio#287 regarding toggle button for rearrange
Browse files Browse the repository at this point in the history
  • Loading branch information
David McReynolds committed Oct 21, 2014
1 parent 58cac28 commit 0e11583
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions fuel/modules/fuel/assets/js/fuel/controller/BaseFuelController.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ fuel.controller.BaseFuelController = jqx.lib.BaseController.extend({
var itemViewsCookie = $.supercookie(this.uiCookie, itemViewsCookieId);

$('#toggle_tree').click(function(e){
_this._toggleRearrangeBtn();

$('#toggle_tree').parent().addClass('active');
if ($('#rearrange').parent().hasClass('active')){
Expand All @@ -202,6 +201,8 @@ fuel.controller.BaseFuelController = jqx.lib.BaseController.extend({
// lazy load tree
if (!_this.treeLoaded){
_this.redrawTree();
} else {
_this._toggleRearrangeBtn();
}
return false;
});
Expand All @@ -220,6 +221,8 @@ fuel.controller.BaseFuelController = jqx.lib.BaseController.extend({
// lazy load table
if (!_this.tableLoaded){
_this.redrawTable();
} else {
_this._toggleRearrangeBtn();
}
return false;
});
Expand Down Expand Up @@ -603,17 +606,10 @@ fuel.controller.BaseFuelController = jqx.lib.BaseController.extend({
},

_toggleRearrangeBtn : function(){

// remove the button if no precedence columns
if (!$('#precedence').length)
{
$('.ico_precedence').parent().remove();
}

if ($('#precedence').val() != 1){
$('#rearrange').parent().hide();
} else {
if (!$('#list_container').is(':hidden') && parseInt($('#precedence').val()) == 1){
$('#rearrange').parent().show();
} else {
$('#rearrange').parent().hide();
}
},

Expand Down Expand Up @@ -645,7 +641,7 @@ fuel.controller.BaseFuelController = jqx.lib.BaseController.extend({
if (!_this.treeLoaded) _this.treeLoaded = true;

// setup rearranging precedence
$('#rearrange').parent().hide();
_this._toggleRearrangeBtn();

},

Expand All @@ -662,7 +658,6 @@ fuel.controller.BaseFuelController = jqx.lib.BaseController.extend({
$.post(_this.modulePath + '/toggle_' + toggleStatus + '/' + id + '/' + field, params, function(html){
_this.redrawTable(true, false);
});

}

$('#data_table .publish_text').parent().addClass('publish_col');
Expand Down

0 comments on commit 0e11583

Please sign in to comment.