From feba7892ac82078a570a6c7c56e5e0b8c34798f8 Mon Sep 17 00:00:00 2001 From: Emanuele Gaspari Date: Fri, 29 Jun 2012 22:22:23 +0200 Subject: [PATCH] added 'add reference to original option element' in doc --- index.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 6ff3cd8a..5c5337f4 100755 --- a/index.html +++ b/index.html @@ -342,7 +342,7 @@ version: 2.1

Example Code


         

- You can set data- attributes to <option> (or <optgroup>) and use them inside temptlating functions: + You can set data- attributes to <option> (or <optgroup>) and use them inside temptlating functions:

             <select>
@@ -352,7 +352,8 @@ version: 2.1
         
             function format(state) {
-                var originalOption = state.element
+                var originalOption = state.element;
+                
                 return "<img class='flag' src='images/flags/" + state.id.toLowerCase() + ".png' alt='" + originalOption.data('foo') + "' />" + state.text;
             }
         
@@ -789,8 +790,8 @@ version: 2.1 <returns>stringHtml that represents the selection The default implementation expects the object to have a text property that is returned. -
- Original <option> (or <optgroup>) element is accessible inside the specified function by property item.element +

+ Original <option> (or <optgroup>) element is accessible inside the specified function by property item.element:
         format(item) {
             var originalOption = item.element;
@@ -807,8 +808,8 @@ version: 2.1
         <returns>stringHtml that represents the result
     
     The default implementation expects the object to have a text property that is returned.
-    
- Original <option> (or <optgroup>) element is accessible inside the specified function by property item.element +

+ Original <option> (or <optgroup>) element is accessible inside the specified function by property item.element:
         format(item) {
             var originalOption = item.element;