diff --git a/etemplate/js/et2_widget_favorites.js b/etemplate/js/et2_widget_favorites.js index 1ad5031817..1850e230a0 100644 --- a/etemplate/js/et2_widget_favorites.js +++ b/etemplate/js/et2_widget_favorites.js @@ -242,26 +242,30 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader], var name = $j(this).parentsUntil("li").parent().attr("id"); // 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 - $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()); + // Hide the trash + $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()); + } + 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 diff --git a/etemplate/js/et2_widget_tabs.js b/etemplate/js/et2_widget_tabs.js index 66aad0a32e..c05bf36d1c 100644 --- a/etemplate/js/et2_widget_tabs.js +++ b/etemplate/js/et2_widget_tabs.js @@ -173,7 +173,7 @@ var et2_tabbox = et2_DOMWidget.extend( } // Add any extra tabs - if(this.options.tabs.length) + if(this.options.tabs) { var readonly = this.getArrayMgr("readonlys").getEntry(this.id) || {}; for(var i = 0; i < this.options.tabs.length; i++)