From 4161e10192256b578af7353928ea2955395a1e57 Mon Sep 17 00:00:00 2001 From: vitalets <noginsk@rambler.ru> Date: Fri, 18 Jan 2013 16:24:01 +0400 Subject: [PATCH] comments for selector --- src/element/editable-element.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/element/editable-element.js b/src/element/editable-element.js index 0849836..c00ab72 100644 --- a/src/element/editable-element.js +++ b/src/element/editable-element.js @@ -662,10 +662,12 @@ Makes editable any HTML element on the page. Applied as jQuery method. **/ unsavedclass: 'editable-unsaved', /** - If a css selector is provided, editable will be delegated to the specified targets. + If selector is provided, editable will be delegated to the specified targets. Usefull for dynamically generated DOM elements. - **Please note**, that delegated targets can't use `emptytext` and `autotext` options, - as they are initialized after first click. + **Please note**, that delegated targets can't be initialized with `emptytext` and `autotext` options, + as they actually become editable only after first click. + You should manually set class `editable-click` to these elements. + Also, if element originally empty you should add class `editable-empty`, set `data-value=""` and write emptytext into element: @property selector @type string @@ -673,8 +675,10 @@ Makes editable any HTML element on the page. Applied as jQuery method. @default null @example <div id="user"> - <a href="#" data-name="username" data-type="text" title="Username">awesome</a> - <a href="#" data-name="group" data-type="select" data-source="/groups" data-value="1" title="Group">Operator</a> + <!-- empty --> + <a href="#" data-name="username" data-type="text" class="editable-click editable-empty" data-value="" title="Username">Empty</a> + <!-- non-empty --> + <a href="#" data-name="group" data-type="select" data-source="/groups" data-value="1" class="editable-click" title="Group">Operator</a> </div> <script>