diff --git a/etemplate/js/et2_widget_checkbox.js b/etemplate/js/et2_widget_checkbox.js index 7674e03395..231e0a85c7 100644 --- a/etemplate/js/et2_widget_checkbox.js +++ b/etemplate/js/et2_widget_checkbox.js @@ -88,9 +88,9 @@ var et2_checkbox = et2_inputWidget.extend( if(_value == this.options.selected_value || _value && this.options.selected_value == this.__proto__.attributes.selected_value["default"] && _value != this.options.unselected_value) { - this.input.attr("checked", "checked"); + this.input.prop("checked", true); } else { - this.input.removeAttr("checked"); + this.input.prop("checked", false); } } }, @@ -99,7 +99,7 @@ var et2_checkbox = et2_inputWidget.extend( * Override default to return unchecked value */ getValue: function() { - if(this.input.attr("checked")) { + if(this.input.prop("checked")) { return this.options.selected_value; } else { return this.options.unselected_value; diff --git a/etemplate/js/et2_widget_dialog.js b/etemplate/js/et2_widget_dialog.js index 9b9b0f20d7..7ca0d11cdb 100644 --- a/etemplate/js/et2_widget_dialog.js +++ b/etemplate/js/et2_widget_dialog.js @@ -233,16 +233,19 @@ var et2_dialog = et2_widget.extend({ * Clean up dialog */ destroy: function() { - // Un-dialog the dialog - this.div.dialog("destroy"); - - if(this.template) + if(this.div != null) { - this.template.clear(); - this.template = null; - } + // Un-dialog the dialog + this.div.dialog("destroy"); - this.div = null; + if(this.template) + { + this.template.clear(); + this.template = null; + } + + this.div = null; + } // Call the inherited constructor this._super.apply(this, arguments); diff --git a/etemplate/js/et2_widget_diff.js b/etemplate/js/et2_widget_diff.js index 06ce68bc81..98029c5fe7 100644 --- a/etemplate/js/et2_widget_diff.js +++ b/etemplate/js/et2_widget_diff.js @@ -85,7 +85,7 @@ var et2_diff = et2_valueWidget.extend([et2_IDetachedDOM], buttons: [{text: self.egw().lang('ok'), click: function() {jQuery(this).dialog("close");}}], close: function(event, ui) { // Need to destroy the dialog, etemplate widget needs divs back where they were - diff.dialog("destroy"); + dialog_div.dialog("destroy"); self.minify(this); // Put it back where it came from, or et2 will error when clear() is called diff --git a/etemplate/js/et2_widget_favorites.js b/etemplate/js/et2_widget_favorites.js index 6c4d39d40a..730f6b0d85 100644 --- a/etemplate/js/et2_widget_favorites.js +++ b/etemplate/js/et2_widget_favorites.js @@ -185,8 +185,11 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader], }, destroy: function() { - this.popup.dialog("destroy"); - this.popup = null; + if(this.popup != null) + { + this.popup.dialog("destroy"); + this.popup = null; + } if(this.sidebox_target.length) { this.sidebox_target diff --git a/etemplate/js/et2_widget_file.js b/etemplate/js/et2_widget_file.js index 5907e0c09b..9e46e9cc25 100644 --- a/etemplate/js/et2_widget_file.js +++ b/etemplate/js/et2_widget_file.js @@ -140,6 +140,7 @@ var et2_file = et2_inputWidget.extend( }, destroy: function() { + this._super.apply(this, arguments); this.node = null; this.input = null; this.progress = null; diff --git a/etemplate/js/et2_widget_historylog.js b/etemplate/js/et2_widget_historylog.js index eb9b62c702..a1030dcd2b 100644 --- a/etemplate/js/et2_widget_historylog.js +++ b/etemplate/js/et2_widget_historylog.js @@ -115,7 +115,11 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider], * Finish initialization which was skipped until tab was selected */ finishInit: function() { - + // No point with no ID + if(!this.options.value || !this.options.value.id) + { + return; + } this._filters = { record_id: this.options.value.id, appname: this.options.value.app, diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index 7cbeca1832..d45fa6b3c0 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -526,7 +526,8 @@ var et2_link_entry = et2_inputWidget.extend( return false; }, minLength: self.minimum_characters, - disabled: self.options.disabled + disabled: self.options.disabled, + appendTo: self.div }); // Custom display (colors) @@ -711,7 +712,7 @@ var et2_link_entry = et2_inputWidget.extend( } this.options.value = _value; - jQuery("option[value='"+_value.app+"']",this.app_select).attr("selected",true); + jQuery("option[value='"+_value.app+"']",this.app_select).prop("selected",true); this.app_select.hide(); this.div.addClass("no_app"); }, diff --git a/etemplate/js/et2_widget_radiobox.js b/etemplate/js/et2_widget_radiobox.js index 548a37c829..5f744e9da3 100644 --- a/etemplate/js/et2_widget_radiobox.js +++ b/etemplate/js/et2_widget_radiobox.js @@ -98,9 +98,9 @@ var et2_radiobox = et2_inputWidget.extend( */ set_value: function(_value) { if(_value == this.options.set_value) { - this.input.attr("checked", "checked"); + this.input.prop("checked", true); } else { - this.input.removeAttr("checked"); + this.input.prop("checked", false); } }, diff --git a/etemplate/js/et2_widget_selectAccount.js b/etemplate/js/et2_widget_selectAccount.js index 519960b6d4..bce9920c87 100644 --- a/etemplate/js/et2_widget_selectAccount.js +++ b/etemplate/js/et2_widget_selectAccount.js @@ -186,7 +186,7 @@ var et2_selectAccount = et2_selectbox.extend( // Put search results as a DOM sibling of the options, for proper display this.search_widget.search.on("autocompleteopen", jQuery.proxy(function() { - this.search_widget.search.data("autocomplete").menu.element.appendTo(this.node); + this.search_widget.search.data("ui-autocomplete").menu.element.appendTo(this.node); },this)); this.search = jQuery(document.createElement("li")) .appendTo(this.multiOptions.prev().find('ul')); @@ -405,7 +405,7 @@ var et2_selectAccount = et2_selectbox.extend( // Override link-entry auto-complete for custom display // Don't show normal drop-down - search_widget.search.data("autocomplete")._suggest = function(items) { + search_widget.search.data("ui-autocomplete")._suggest = function(items) { jQuery.each(items, function (index, item) { self._add_search_result(results, item); }); diff --git a/etemplate/js/et2_widget_selectbox.js b/etemplate/js/et2_widget_selectbox.js index d17205c850..8fd29cded2 100644 --- a/etemplate/js/et2_widget_selectbox.js +++ b/etemplate/js/et2_widget_selectbox.js @@ -467,24 +467,24 @@ var et2_selectbox = et2_inputWidget.extend( // Unchanged if(_value == this.value) return; } - jQuery("option",this.input).attr("selected", false); + jQuery("option",this.input).prop("selected", false); if(typeof _value == "array") { for(var i = 0; i < _value.length; i++) { - jQuery("option[value='"+_value[i]+"']", this.input).attr("selected", true); + jQuery("option[value='"+_value[i]+"']", this.input).prop("selected", true); } } else if (typeof _value == "object") { for(var i in _value) { - jQuery("option[value='"+_value[i]+"']", this.input).attr("selected", true); + jQuery("option[value='"+_value[i]+"']", this.input).prop("selected", true); } } else { - if(jQuery("option[value='"+_value+"']", this.input).attr("selected", true).length == 0) + if(jQuery("option[value='"+_value+"']", this.input).prop("selected", true).length == 0) { if(this.options.select_options[_value]) { @@ -499,24 +499,24 @@ var et2_selectbox = et2_inputWidget.extend( }, set_multi_value: function(_value) { - jQuery("input",this.multiOptions).attr("checked", false); + jQuery("input",this.multiOptions).prop("checked", false); if(typeof _value == "array") { for(var i = 0; i < _value.length; i++) { - jQuery("input[value='"+_value[i]+"']", this.multiOptions).attr("checked", true); + jQuery("input[value='"+_value[i]+"']", this.multiOptions).prop("checked", true); } } else if (typeof _value == "object") { for(var i in _value) { - jQuery("input[value='"+_value[i]+"']", this.multiOptions).attr("checked", true); + jQuery("input[value='"+_value[i]+"']", this.multiOptions).prop("checked", true); } } else { - if(jQuery("input[value='"+_value+"']", this.multiOptions).attr("checked", true).length == 0) + if(jQuery("input[value='"+_value+"']", this.multiOptions).prop("checked", true).length == 0) { this.egw().debug("warning", "Tried to set value that isn't an option", this, _value); } @@ -726,7 +726,7 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], // Translate the options if(!this.options.no_lang) { - if (typeof _options[key] === 'object') + if (typeof _options[key] === 'object' && _options[key] != null) { if(_options[key]["label"]) _options[key]["label"] = this.egw().lang(_options[key]["label"]); if(_options[key]["title"]) _options[key]["title"] = this.egw().lang(_options[key]["title"]); diff --git a/etemplate/js/et2_widget_url.js b/etemplate/js/et2_widget_url.js index 286edbfe0d..69c45c4191 100644 --- a/etemplate/js/et2_widget_url.js +++ b/etemplate/js/et2_widget_url.js @@ -53,6 +53,7 @@ var et2_url = et2_textbox.extend( this.input.unbind(); } this._button = null; + this._super.apply(this); }, /** diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index baf4a22bbf..173b1b7375 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -804,7 +804,7 @@ div.message.floating { .nextmatch_header .header_count { padding: 0px 20px; - margin: 5px 20px 0px; + margin: 6px 20px 0px; border: 1px solid #E0E0E0; float:right; font-size: 150%; @@ -837,8 +837,8 @@ div.message.floating { margin-bottom: 3px; } /* Favorites */ -.nextmatch_header div#favorite_wrapper { - margin-top: 8px; +.nextmatch_header div[id$=favorite_wrapper] { + margin-top: 6px; vertical-align: middle; } #nm_favorites_popup_filters .filter_id, #nm_favorites_popup_filters .filter_value { @@ -848,7 +848,7 @@ div.message.floating { .nextmatch_header ul.favorites { min-width: 20ex; } -.nextmatch_header .favorites li a { +.nextmatch_header .favorites li .ui-menu .ui-menu-item a { text-indent: -22px; margin-left: 21px; } @@ -862,6 +862,7 @@ div.message.floating { margin-right: 1ex; } .favorites div.ui-icon-trash { + position: relative; float:right; display:none; } @@ -891,12 +892,14 @@ div.message.floating { text-decoration: underline; } .sidebox-favorites .favorites div.ui-icon-heart{ + position: relative; float: left; display:inline-block; margin: -3px 1px 0px 1px; } .sidebox-favorites .favorites div.ui-icon-trash{ - margin-top: -3px; + margin-top: -5px; + margin-right: 2px; } .nextmatch_sortheader { color: #003075;