Modal confirm dialogs for dangerous actions.
Squashed commit of the following: commit80513dd206Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Aug 31 08:26:39 2013 +0100 use blockquote to make dialog more readable commitbab8e4d00cAuthor: Oliver Gorwits <oliver@cpan.org> Date: Sat Aug 31 08:16:49 2013 +0100 add confirm dialog to user delete commit46c7d54973Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Aug 31 07:46:52 2013 +0100 add confirm dialog to pseudo device delete commit00f26b92a9Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Aug 31 07:41:41 2013 +0100 restore aria header ref commit1c04d32cd2Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Aug 31 07:38:39 2013 +0100 add confirm dialog to topo link delete commit914a03a19cAuthor: Oliver Gorwits <oliver@cpan.org> Date: Sat Aug 31 07:12:59 2013 +0100 tidy dialogs commite4c3978ba8Author: Oliver Gorwits <oliver@cpan.org> Date: Fri Aug 30 23:37:55 2013 +0100 remove attr("data- commit626c8c3fddAuthor: Oliver Gorwits <oliver@cpan.org> Date: Fri Aug 30 23:36:47 2013 +0100 log message for port controls commitb614669c0cAuthor: Oliver Gorwits <oliver@cpan.org> Date: Fri Aug 30 21:23:22 2013 +0100 swap attr for data commit79ce5ec47dAuthor: Oliver Gorwits <oliver@cpan.org> Date: Fri Aug 30 21:09:41 2013 +0100 improve delete modal and add log message commit601671b383Author: Oliver Gorwits <oliver@cpan.org> Date: Tue Aug 27 22:46:43 2013 +0100 modal dialog which calls ajax
This commit is contained in:
@@ -59,6 +59,9 @@
|
||||
,delay: 150
|
||||
,minLength: 0
|
||||
});
|
||||
|
||||
// activate modals
|
||||
$('.nd_modal').modal({show: false});
|
||||
}
|
||||
|
||||
// on load, establish global delegations for now and future
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
$('#nd_netmap-help').hide();
|
||||
}
|
||||
|
||||
// activate tooltips and popovers
|
||||
// activate modals, tooltips and popovers
|
||||
$('.nd_modal').modal({show: false});
|
||||
$("[rel=tooltip]").tooltip({live: true});
|
||||
$("[rel=popover]").popover({live: true});
|
||||
}
|
||||
@@ -37,7 +38,7 @@
|
||||
var tab = '[% tab.tag %]'
|
||||
var target = '#' + tab + '_pane';
|
||||
|
||||
// sidebar form fields should change colour and have bin/copy icon
|
||||
// sidebar form fields should change colour and have trash/copy icon
|
||||
form_inputs.each(function() {device_form_state($(this))});
|
||||
form_inputs.change(function() {device_form_state($(this))});
|
||||
|
||||
@@ -52,7 +53,7 @@
|
||||
.toggleClass('icon-chevron-up icon-chevron-down');
|
||||
});
|
||||
|
||||
// handler for bin icon in port filter box
|
||||
// handler for trashcan icon in port filter box
|
||||
var portfilter = $('#ports_form').find("input[name=f]");
|
||||
$('.nd_field-clear-icon').click(function() {
|
||||
portfilter.val('');
|
||||
@@ -101,15 +102,24 @@
|
||||
,async: true
|
||||
,dataType: 'html'
|
||||
,url: uri_base + '/ajax/control/admin/' + mode
|
||||
,data: tr.find('input[data-form="' + mode + '"]').serializeArray()
|
||||
,data: tr.find('input[data-form="' + mode + '"],textarea[data-form="' + mode + '"]').serializeArray()
|
||||
,success: function() {
|
||||
toastr.info('Queued '+ mode +' for device '+ tr.attr('data-for-device'));
|
||||
toastr.info('Queued '+ mode +' for device '+ tr.data('for-device'));
|
||||
}
|
||||
// skip any error reporting for now
|
||||
// TODO: fix sanity_ok in Netdisco Web
|
||||
,error: function() {
|
||||
toastr.error('Failed to queue '+ mode +' for device '+ tr.attr('data-for-device'));
|
||||
toastr.error('Failed to queue '+ mode +' for device '+ tr.data('for-device'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// bootstrap modal mucks about with mouse actions on higher elements
|
||||
// so need to bury and raise it when needed
|
||||
$('#ports_pane').on('show', '.nd_modal', function () {
|
||||
$(this).toggleClass('nd_deep-horizon');
|
||||
});
|
||||
$('#ports_pane').on('hidden', '.nd_modal', function () {
|
||||
$(this).toggleClass('nd_deep-horizon');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user