Permalink
Browse files

Recompiled to JS

  • Loading branch information...
1 parent 7dc2d08 commit 0546e3d220bd3e5a5c6daab38e86453e500d7c58 @meltingice committed Apr 5, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 docs/ajax-chosen.html
  2. +1 −1 lib/ajax-chosen.js
  3. +1 −1 lib/ajax-chosen.min.js
View
@@ -45,7 +45,7 @@
value => text pairs to inject as <option> elements.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">items = </span><span class="nx">callback</span> <span class="nx">data</span>
</pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <p>Iterate through the given data and inject the <option> elements into
the DOM if it doesn't exist in the selector already</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">$</span><span class="p">.</span><span class="nx">each</span> <span class="nx">items</span><span class="p">,</span> <span class="nf">(value, text) -&gt;</span>
- <span class="k">if</span> <span class="nx">selected_values</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">value</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="nx">text</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span>
+ <span class="k">if</span> <span class="nx">$</span><span class="p">.</span><span class="nx">inArray</span><span class="p">(</span><span class="nx">value</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="nx">text</span><span class="p">,</span> <span class="nx">selected_values</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span>
<span class="nx">$</span><span class="p">(</span><span class="s2">&quot;&lt;option /&gt;&quot;</span><span class="p">)</span>
<span class="p">.</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;value&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span>
<span class="p">.</span><span class="nx">html</span><span class="p">(</span><span class="nx">text</span><span class="p">)</span>
View
@@ -43,7 +43,7 @@
});
items = callback(data);
$.each(items, function(value, text) {
- if (selected_values.indexOf(value + "-" + text) === -1) {
+ if ($.inArray(value + "-" + text, selected_values) === -1) {
return $("<option />").attr('value', value).html(text).appendTo(select);
}
});
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 0546e3d

Please sign in to comment.