mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-30 03:43:40 +01:00
Use new dialog to confirm favorite deletion
This commit is contained in:
parent
07a157ad1a
commit
73f1cd921b
@ -242,26 +242,30 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
|
|||||||
var name = $j(this).parentsUntil("li").parent().attr("id");
|
var name = $j(this).parentsUntil("li").parent().attr("id");
|
||||||
|
|
||||||
// Make sure first
|
// Make sure first
|
||||||
if(!confirm(header.egw().lang("Delete") + " " +header.stored_filters[name].name +"?")) return;
|
var do_delete = function(button_id)
|
||||||
|
{
|
||||||
|
if(button_id != et2_dialog.YES_BUTTON) return;
|
||||||
|
|
||||||
// Hide the trash
|
// Hide the trash
|
||||||
$j(this).hide();
|
$j(this).hide();
|
||||||
|
|
||||||
// Delete preference server side
|
|
||||||
var request = new egw_json_request("etemplate_widget_nextmatch::ajax_set_favorite::etemplate",
|
|
||||||
[header.app, name, "delete", header.stored_filters[name].group ? header.stored_filters[name].group : '', ''],
|
|
||||||
header
|
|
||||||
);
|
|
||||||
request.sendRequest(true, function(result) {
|
|
||||||
if(result)
|
|
||||||
{
|
|
||||||
// Remove line from list
|
|
||||||
this.slideUp("slow", function() { header.menu.hide();});
|
|
||||||
delete header.stored_filters[name];
|
|
||||||
header.init_filters(header);
|
|
||||||
}
|
|
||||||
}, $j(this).parentsUntil("li").parent());
|
|
||||||
|
|
||||||
|
// Delete preference server side
|
||||||
|
var request = new egw_json_request("etemplate_widget_nextmatch::ajax_set_favorite::etemplate",
|
||||||
|
[header.app, name, "delete", header.stored_filters[name].group ? header.stored_filters[name].group : '', ''],
|
||||||
|
header
|
||||||
|
);
|
||||||
|
request.sendRequest(true, function(result) {
|
||||||
|
if(result)
|
||||||
|
{
|
||||||
|
// Remove line from list
|
||||||
|
this.slideUp("slow", function() { header.menu.hide();});
|
||||||
|
delete header.stored_filters[name];
|
||||||
|
header.init_filters(header);
|
||||||
|
}
|
||||||
|
}, $j(this).parentsUntil("li").parent());
|
||||||
|
}
|
||||||
|
et2_dialog.show_dialog(do_delete, (header.egw().lang("Delete") + " " +header.stored_filters[name].name +"?"),
|
||||||
|
"Delete", et2_dialog.YES_NO, et2_dialog.QUESTION_MESSAGE);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Create & set filter options for dropdown menu
|
// Create & set filter options for dropdown menu
|
||||||
|
@ -173,7 +173,7 @@ var et2_tabbox = et2_DOMWidget.extend(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add any extra tabs
|
// Add any extra tabs
|
||||||
if(this.options.tabs.length)
|
if(this.options.tabs)
|
||||||
{
|
{
|
||||||
var readonly = this.getArrayMgr("readonlys").getEntry(this.id) || {};
|
var readonly = this.getArrayMgr("readonlys").getEntry(this.id) || {};
|
||||||
for(var i = 0; i < this.options.tabs.length; i++)
|
for(var i = 0; i < this.options.tabs.length; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user