فهرست منبع

Merge branch 'patch-1' of https://github.com/marcaparent/select2

alexweissman 7 سال پیش
والد
کامیت
b0e5197e00
1فایلهای تغییر یافته به همراه24 افزوده شده و 2 حذف شده
  1. 24 2
      docs/_includes/examples/tags.html

+ 24 - 2
docs/_includes/examples/tags.html

@@ -2,7 +2,7 @@
   <h1 id="tags">Tagging support</h1>
 
   <p>
-    Select2 can be used to quickly set up fields used for tagging.
+    Select2 can be used to quickly set up fields used for tagging. 
   </p>
 
   <p>
@@ -13,7 +13,7 @@
 
   <div class="s2-example">
     <p>
-      <select class="js-example-tags form-control" multiple="multiple">
+      <select class="js-example-tags-multiple form-control" multiple="multiple">
         <option selected="selected">orange</option>
         <option>white</option>
         <option selected="selected">purple</option>
@@ -21,9 +21,31 @@
     </p>
   </div>
 
+{% highlight js linenos %}
+$(".js-example-tags-multiple").select2({
+  tags: true
+})
+{% endhighlight %}
+  
+  <p>
+    Tagging can also be used on a single select element. Simply remove the
+    <code>multiple="multiple"</code> attribute from your HTML markup.
+  </p>
+  
+  <div class="s2-example">
+    <p>
+      <select class="js-example-tags form-control">
+        <option selected="selected">orange</option>
+        <option>white</option>
+        <option>purple</option>
+      </select>
+    </p>
+  </div>
+
 {% highlight js linenos %}
 $(".js-example-tags").select2({
   tags: true
 })
 {% endhighlight %}
+  
 </section>