From e4ac846d2a7e74d702c96a5536f9bc2147cffe86 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 3 Dec 2014 16:23:10 +0000 Subject: [PATCH] add blur attribute to date-widget --- etemplate/js/et2_widget_date.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etemplate/js/et2_widget_date.js b/etemplate/js/et2_widget_date.js index 07541750c8..9c76e15aee 100644 --- a/etemplate/js/et2_widget_date.js +++ b/etemplate/js/et2_widget_date.js @@ -37,6 +37,12 @@ var et2_date = et2_inputWidget.extend( "type": { "ignore": false }, + "blur": { + "name": "Placeholder", + "type": "string", + "default": "", + "description": "This text get displayed if an input-field is empty and does not have the input-focus (blur). It can be used to show a default value or a kind of help-text." + }, "data_format": { "ignore": true, "description": "Date/Time format. Can be set as an options to date widget", @@ -68,6 +74,7 @@ var et2_date = et2_inputWidget.extend( this.span = $j(document.createElement("span")).addClass("et2_date"); this.input_date = $j(document.createElement("input")); + if (this.options.blur) this.input_date.attr('placeholder', this.egw().lang(this.options.blur)); this.input_date.addClass("et2_date").attr("type", "text") .attr("size", 7) // strlen("10:00pm")=7 .appendTo(this.span);