mirror of
https://github.com/myvesta/vesta
synced 2025-07-15 01:23:23 -07:00
Tab switching "x records" message is resetting from now on. Added "do nothing" for batch operations. Closes #15
This commit is contained in:
parent
c8c8e90435
commit
f2c1e0ed5e
3 changed files with 25 additions and 3 deletions
|
@ -217,7 +217,7 @@
|
||||||
<div id="batch-processor" class="b-row-selector">
|
<div id="batch-processor" class="b-row-selector">
|
||||||
<div class="checkbox-selector cc">
|
<div class="checkbox-selector cc">
|
||||||
<input class="styled do_action_toggle_batch_selector" autocomplete="off" type="checkbox" value="" />
|
<input class="styled do_action_toggle_batch_selector" autocomplete="off" type="checkbox" value="" />
|
||||||
<span class="selector-title">All</span>
|
<span class="selector-title">None</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="context-actions c-s-box">
|
<div class="context-actions c-s-box">
|
||||||
<div class="b-cust-sel complex-select c-s-opt">
|
<div class="b-cust-sel complex-select c-s-opt">
|
||||||
|
@ -226,6 +226,10 @@
|
||||||
<div class="cust-sel-arrow do_action_toggle_custom_select c-s-opt"><i class="do_action_toggle_custom_select"> </i></div>
|
<div class="cust-sel-arrow do_action_toggle_custom_select c-s-opt"><i class="do_action_toggle_custom_select"> </i></div>
|
||||||
<div class="cust-sel-options complex-select-content c-s-opt hidden">
|
<div class="cust-sel-options complex-select-content c-s-opt hidden">
|
||||||
<div class="cust-sel-option ico_gray c-s-opt do_action_update_cs_value">
|
<div class="cust-sel-option ico_gray c-s-opt do_action_update_cs_value">
|
||||||
|
<input type="hidden" class="c-s-value" value="Nothing">
|
||||||
|
Nothing
|
||||||
|
</div>
|
||||||
|
<div class="cust-sel-option ico_gray c-s-opt do_action_update_cs_value">
|
||||||
<input type="hidden" class="c-s-value" value="Suspend">
|
<input type="hidden" class="c-s-value" value="Suspend">
|
||||||
Suspend
|
Suspend
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -54,6 +54,11 @@ App.Actions.update_cs_value = function(evt)
|
||||||
var val = elm.find('.c-s-value').val();
|
var val = elm.find('.c-s-value').val();
|
||||||
$('.complex-select-content').addClass('hidden');
|
$('.complex-select-content').addClass('hidden');
|
||||||
|
|
||||||
|
if (val.toLowerCase() == 'nothing') {
|
||||||
|
App.Actions.mass_nothing();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (App.Tmp[App.Env.world + '_selected_records'] > 0) {
|
if (App.Tmp[App.Env.world + '_selected_records'] > 0) {
|
||||||
var confirm_message_key = App.Tmp[App.Env.world + '_selected_records'] == 1 ? 1 + ' record' : App.Tmp[App.Env.world + '_selected_records'] + ' records';
|
var confirm_message_key = App.Tmp[App.Env.world + '_selected_records'] == 1 ? 1 + ' record' : App.Tmp[App.Env.world + '_selected_records'] + ' records';
|
||||||
var confirmed = confirm('This action will ' + val.toLowerCase() + ' ' + confirm_message_key + '. Do you want to proceede?');
|
var confirmed = confirm('This action will ' + val.toLowerCase() + ' ' + confirm_message_key + '. Do you want to proceede?');
|
||||||
|
@ -83,6 +88,11 @@ App.Actions.mass_unsuspend = function()
|
||||||
App.Actions.reset_batch();
|
App.Actions.reset_batch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App.Actions.mass_nothing = function()
|
||||||
|
{
|
||||||
|
$('.complex-select-content').addClass('hidden');
|
||||||
|
}
|
||||||
|
|
||||||
App.Actions.mass_action = function(method_name)
|
App.Actions.mass_action = function(method_name)
|
||||||
{
|
{
|
||||||
var rows = $('.checked-row');
|
var rows = $('.checked-row');
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
App.Pages.init = function()
|
App.Pages.init = function()
|
||||||
{
|
{
|
||||||
if ('undefined' == typeof App.Env.initialParams) {
|
if ('undefined' == typeof App.Env.initialParams) { // first run
|
||||||
App.Ajax.request('MAIN.getInitial', {}, function(reply) {
|
App.Ajax.request('MAIN.getInitial', {}, function(reply) {
|
||||||
App.Env.initialParams = reply.data;
|
App.Env.initialParams = reply.data;
|
||||||
App.Helpers.updateInitial();
|
App.Helpers.updateInitial();
|
||||||
|
if (!App.Env.initialParams.auth_user.admin) {
|
||||||
|
var head= document.getElementsByTagName('head')[0];
|
||||||
|
var script= document.createElement('script');
|
||||||
|
script.type= 'text/javascript';
|
||||||
|
script.src= App.Helpers.generateUrl('js/user_templates.js?'+Math.random());
|
||||||
|
head.appendChild(script);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +25,7 @@ App.Pages.init = function()
|
||||||
|
|
||||||
App.Pages.prepareHTML = function()
|
App.Pages.prepareHTML = function()
|
||||||
{
|
{
|
||||||
|
App.Actions.reset_batch();
|
||||||
$('#actions-toolbar .stats-subbar').remove();
|
$('#actions-toolbar .stats-subbar').remove();
|
||||||
$('#actions-toolbar .do_action_new_entry').removeClass('hidden');
|
$('#actions-toolbar .do_action_new_entry').removeClass('hidden');
|
||||||
$('.active').removeClass('active');
|
$('.active').removeClass('active');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue