From 06af26b1c814cf0db924218ddf80ccd019cab5ad Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 21 Oct 2013 22:54:48 +0100 Subject: [PATCH] Give the edit-text widget support for the placeholder attribute --- core/modules/new_widgets/edit-text.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/modules/new_widgets/edit-text.js b/core/modules/new_widgets/edit-text.js index d961f2d33..4e4bb6fde 100644 --- a/core/modules/new_widgets/edit-text.js +++ b/core/modules/new_widgets/edit-text.js @@ -41,6 +41,9 @@ EditTextWidget.prototype.render = function(parent,nextSibling) { if(this.editType) { domNode.setAttribute("type",this.editType); } + if(this.editPlaceholder) { + domNode.setAttribute("placeholder",this.editPlaceholder); + } // Assign classes domNode.className = this.editClass; // Set the text @@ -104,6 +107,7 @@ EditTextWidget.prototype.execute = function() { this.editIndex = this.getAttribute("index"); this.editDefault = this.getAttribute("default",""); this.editClass = this.getAttribute("class"); + this.editPlaceholder = this.getAttribute("placeholder"); // Get the editor element tag and type var tag,type; if(this.editField === "text") {