share/views/public/js/rbbt/actions.js in rbbt-rest-1.6.2 vs share/views/public/js/rbbt/actions.js in rbbt-rest-1.6.3
- old
+ new
@@ -69,11 +69,11 @@
_create: function() {
var tool = this
var controller = tool.element;
- controller.on('click', '> .actions .button', function(e){ tool._activate_action(this); return false});
+ controller.on('click', '> .action_menu .button', function(e){ tool._activate_action(this); return false});
controller.on('click', '> .controls > .reload', function(e){ tool._reload_action(this); return false});
controller.on('click', '> .controls > .parameters', function(e){ tool._display_parameters(this); return false});
controller.on('click', '> .controls > .description', function(e){ tool._display_description(this); return false});
controller.on('click', '> .controls > .pin', function(e){ tool._toggle_pin(this); return false});
controller.on('click', '> .controls > .url', function(e){ tool._toogle_track(this); return false});
@@ -82,32 +82,32 @@
tool._untrack(link.attr('href'))
})
this.options.controller = controller
this.options.action_controls = controller.find('> .controls')
- this.options.action_list = controller.find('> .actions')
+ this.options.action_list = controller.find('> .action_menu')
this.options.complete = function(jqXHR, textStatus){
var action_controller = tool.options.controller
- var action_list_item = action_controller.find('.actions > .loading, .actions > .active')
+ var action_list_item = action_controller.find('.action_menu > .loading, .action_menu > .active')
var action_div = action_controller.next('.action_loader');
if (jqXHR.status == 202){
if (action_div.attr('reload-attempts') != '0'){
action_controller.removeClass('active').addClass('loading');
var response = $(jqXHR.responseText)
var stat = response.find('span.status').html()
var message = response.find('.step_messages li:first').html()
+ var progress = response.find('.step.progress')
- if (undefined === message){
- action_div.html("<span class='loading ui message'>Loading [" + stat + "] ...</span>");
- }else{
- action_div.html("<span class='loading ui message'>Loading [" + stat + ": " + message + "] ...</span>");
- };
+ text = [$('<div class="header">').html(stat), $('<div class="content">').html(message)]
+ action_controller.find('> .progress').html("").append(text).append(progress);
+ update_rbbt()
}
}else{
+ action_controller.find('> .progress').html("");
action_controller.removeClass('loading').removeClass('disabled');
action_list_item.removeClass('loading').removeClass('disabled');
action_controller.find('.controls > .reload').removeClass('disabled');
}
@@ -140,11 +140,11 @@
}
},
_activate_action: function(e){
var action_list_item = $(e)
- var action_list = action_list_item.parent('.actions');
+ var action_list = action_list_item.parent('.action_menu');
var link = action_list_item.find('> a')
link = action_list_item
this._load_action(link);
@@ -163,26 +163,26 @@
return false
},
_unpin_parameters: function(){
var controller = $(this.element)
- var action = controller.find('.actions .active a').first().html()
+ var action = controller.find('.action_menu .active a').first().html()
this.options.saved[action] = undefined
controller.find('> .controls > .pin').removeClass('saved')
},
_pin_parameters: function(){
var controller = $(this.element)
- var action = $(this.element).find('.actions .active a').first().html()
+ var action = $(this.element).find('.action_menu .active a').first().html()
var loader = $(this.element).next('.action_loader').first();
this.options.saved[action] = loader.attr('form-params')
controller.find('> .controls > .pin').addClass('saved')
this._dump()
},
_toggle_pin: function(){
- var action = $(this.element).find('.actions .active a').first().html()
+ var action = $(this.element).find('.action_menu .active a').first().html()
if (this.options.saved[action] != undefined){
this._unpin_parameters();
}else{
this._pin_parameters();
@@ -210,11 +210,12 @@
return false
},
_reload_action: function(e){
- if(! $(e).hasClass('active')){ return false}
+ if($(e).hasClass('disabled')){ return false}
+ console.log(1)
var action_list_item = $(e);
var action_list = action_list_item.parent('.controls');
var action_controller = action_list.parent('.action_controller');
var action_div = action_controller.next('.action_loader').first();
@@ -262,10 +263,10 @@
},
_load_action: function(link){
var action_list_item = link.parent('.button');
action_list_item = link
- var action_list = action_list_item.parent('.menu');
+ var action_list = action_list_item.parent('.action_menu');
var action_controller = action_list.parents('.action_controller').first();
var action_div = action_controller.next('.action_loader');
var href = link.attr('href')
href = add_parameter(href, '_layout', 'false')