From 69c7697e61be43d7f7ff1e890c0af46b1afcbb43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Tue, 6 Mar 2012 16:29:18 +0000 Subject: [PATCH] Fixed problem with infolog-image 'not-started' not found in grid; causes new problem with some buttons being displayed twice (caused by this.image=null in et2_widget_button.js::180) --- etemplate/js/et2_extension_customfields.js | 4 ++-- etemplate/js/et2_extension_nextmatch.js | 21 ++++++++++----------- etemplate/js/et2_widget_button.js | 5 ++++- etemplate/js/et2_widget_image.js | 1 + 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/etemplate/js/et2_extension_customfields.js b/etemplate/js/et2_extension_customfields.js index 6e7293cc69..5e7af5e803 100644 --- a/etemplate/js/et2_extension_customfields.js +++ b/etemplate/js/et2_extension_customfields.js @@ -235,8 +235,8 @@ var et2_customfields_list = et2_DOMWidget.extend([et2_IDetachedDOM], { }, /** - * Code for implementing et2_IDetachedDOM - */ + * Code for implementing et2_IDetachedDOM + */ getDetachedAttributes: function(_attrs) { _attrs.push("value", "class"); diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index aeb32298ba..e6b1533228 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -300,7 +300,6 @@ var et2_nextmatch = et2_DOMWidget.extend(et2_IResizeable, { return colName; }, - /** * Apply stored user preferences to discovered columns */ @@ -1040,9 +1039,9 @@ et2_register_widget(et2_nextmatch_header, ['nextmatch-header', var et2_nextmatch_customfields = et2_nextmatch_header.extend({ attributes: { 'customfields': { - 'name': 'Custom fields', - 'description': 'Auto filled' - }, + 'name': 'Custom fields', + 'description': 'Auto filled' + }, 'fields': { 'name': "Visible fields", "description": "Auto filled" @@ -1052,10 +1051,10 @@ var et2_nextmatch_customfields = et2_nextmatch_header.extend({ init: function() { // Create the table body and the table - this.tbody = $j(document.createElement("tbody")); - this.table = $j(document.createElement("table")) - .addClass("et2_grid"); - this.table.append(this.tbody); + this.tbody = $j(document.createElement("tbody")); + this.table = $j(document.createElement("table")) + .addClass("et2_grid"); + this.table.append(this.tbody); this.rows = {}; this._super.apply(this, arguments); @@ -1114,9 +1113,9 @@ var et2_nextmatch_customfields = et2_nextmatch_header.extend({ // Table row var row = jQuery(document.createElement("tr")) - .appendTo(this.tbody); - var cf = jQuery(document.createElement("td")) - .appendTo(row); + .appendTo(this.tbody); + var cf = jQuery(document.createElement("td")) + .appendTo(row); this.rows[field_name] = cf[0]; // Create widget by type diff --git a/etemplate/js/et2_widget_button.js b/etemplate/js/et2_widget_button.js index 338c5a2639..cc7fa8ca39 100644 --- a/etemplate/js/et2_widget_button.js +++ b/etemplate/js/et2_widget_button.js @@ -68,7 +68,10 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], { { if(!this.image) { - this.image = et2_createWidget("image",{label: this.options.label}); + this.image = et2_createWidget("image", + { + label: this.options.label + }, this); } found_image = this.image.set_src(this.options.image); if(found_image) { diff --git a/etemplate/js/et2_widget_image.js b/etemplate/js/et2_widget_image.js index 360174b19d..55e5dba63c 100644 --- a/etemplate/js/et2_widget_image.js +++ b/etemplate/js/et2_widget_image.js @@ -122,6 +122,7 @@ var et2_image = et2_baseWidget.extend([et2_IDetachedDOM], { } this.options.src = _value; + var app = this.egw().getAppName(); // Handle app/image