mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-02 11:29:23 +01:00
Use jQueryUI dialog for popups - it looks better, and you can move it out of the way
This commit is contained in:
parent
b464850c12
commit
604d7da979
@ -269,28 +269,44 @@ function nm_open_popup(_action, _ids)
|
|||||||
{
|
{
|
||||||
nm_popup_ids = _ids;
|
nm_popup_ids = _ids;
|
||||||
}
|
}
|
||||||
popup.style.display = 'block';
|
|
||||||
/*
|
|
||||||
Not working yet - DOM manipulation causes et2 problems
|
|
||||||
var dialog = jQuery('.action_popup-content',popup);
|
var dialog = jQuery('.action_popup-content',popup);
|
||||||
var d_buttons = [];
|
if(dialog)
|
||||||
jQuery('button',popup).each(function(index) {
|
{
|
||||||
var but = jQuery(this);
|
var dialog_parent = dialog.parent();
|
||||||
d_buttons.push({
|
var d_buttons = [];
|
||||||
text: but.text(),
|
var action = _action;
|
||||||
click: this.onclick ? this.onclick : function(e) {
|
jQuery('button',popup).each(function(index) {
|
||||||
dialog.dialog("close");
|
var but = jQuery(this);
|
||||||
|
var button = nm_popup_action.data.nextmatch.getRoot().getWidgetById(but.attr("id"));
|
||||||
|
d_buttons.push({
|
||||||
|
text: but.text(),
|
||||||
|
click: button.onclick ? function(e) {
|
||||||
|
dialog.dialog("close");
|
||||||
|
nm_popup_action = action;
|
||||||
|
button.onclick.apply(button, e.currentTarget);
|
||||||
|
} : function(e) {
|
||||||
|
dialog.dialog("close");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
dialog.dialog({
|
||||||
|
title: jQuery('.promptheader',popup).text(),
|
||||||
|
modal: true,
|
||||||
|
buttons: d_buttons,
|
||||||
|
close: function(event, ui) {
|
||||||
// Need to destroy the dialog, etemplate widget needs divs back where they were
|
// Need to destroy the dialog, etemplate widget needs divs back where they were
|
||||||
dialog.dialog("destroy");
|
dialog.dialog("destroy");
|
||||||
nm_popup_action.data.nextmatch.getRoot().getWidgetById(but.attr("id")).onclick.apply(nm_popup_action.data.nextmatch.getRoot().getWidgetById(but.attr("id")), e.currentTarget);}
|
|
||||||
|
// Put it back where it came from, or et2 will error when clear() is called
|
||||||
|
dialog.appendTo(dialog_parent);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
dialog.dialog({
|
|
||||||
title: jQuery('.promptheader',popup).text(),
|
// Reset global variables
|
||||||
modal: true,
|
nm_popup_action = null;
|
||||||
buttons: d_buttons
|
nm_popup_senders = null;
|
||||||
});
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user