From f55641e23a849b65eae41965698df2386c029c2f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 10 Mar 2014 15:08:18 +0000 Subject: [PATCH] do NOT show required color on td, we want it just on input --- etemplate/js/widget_browser.js | 37 ++++++++++++++++++++-- etemplate/templates/default/etemplate2.css | 3 ++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/etemplate/js/widget_browser.js b/etemplate/js/widget_browser.js index 9c28f66013..5227708470 100644 --- a/etemplate/js/widget_browser.js +++ b/etemplate/js/widget_browser.js @@ -40,7 +40,7 @@ function widget_browser(list_div, widget_div) // Create and popuplate the widget list this._init_list(); - + } /** @@ -67,6 +67,7 @@ widget_browser.prototype._init_list = function() for(var i = 0; i < types.length; i++) { list.append('
  • '+types[i]+'
  • '); + this.dump_attributes(types[i]); } // Build attribute table @@ -83,9 +84,41 @@ widget_browser.prototype._init_list = function() ); }; +widget_browser.prototype.dump_attributes = function(_type) +{ + console.log(_type); + + try { + var attrs = {}; + window.wb_widget = this.widget = et2_createWidget(_type, attrs, this.et2.widgetContainer); + this.widget.loadingFinished(); + + if(this.widget !== null && this.widget.attributes) + { + for(var attr in this.widget.attributes) + { + console.log(attr, this.widget.attributes[attr]); + } + } + } + catch(e) { + console.log('*** '+_type+' error '+(typeof e.message != 'undefined' ? e.message : e)); + } + try { + if (this.widget) + { + this.widget.destroy(); + delete this.widget; + } + } + catch(e) { + + } +}; + /** * User selected a widget from the list - * + * * Create an instance of the widget, get its attributes, and display it. */ widget_browser.prototype.select_widget = function(e,f) diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index f854ccaacc..2fb44ad0e3 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -704,6 +704,9 @@ ul.et2_vfs { .et2_required, [required] { background-color: #ffffd0; } +td.et2_required { + background-color: inherit; +} .invalid { border: 1px solid #a6261d; background-color: #faecec;