1
0
mirror of synced 2025-02-09 16:49:24 +03:00

catch up to master

This commit is contained in:
Igor Vaynberg 2013-05-06 20:15:10 -07:00
parent 8eb6c9d330
commit b4ef4061e8
3 changed files with 49 additions and 43 deletions

View File

@ -660,22 +660,26 @@ function log(e) {
}
$("#e11")
.on("change", function(e) { log("change "+JSON.stringify({val:e.val, added:e.added, removed:e.removed})); })
.on("opening", function() { log("opening"); })
.on("open", function() { log("open"); })
.on("close", function() { log("close"); })
.on("highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("selected", function(e) { log ("selected val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("loaded", function(e) { log ("loaded (data property omitted for brevitiy)");});
.on("select2-opening", function() { log("opening"); })
.on("select2-open", function() { log("open"); })
.on("select2-close", function() { log("close"); })
.on("select2-highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("select2-selecting", function(e) { log ("selecting val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("select2-removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("select2-loaded", function(e) { log ("loaded (data property omitted for brevitiy)");})
.on("select2-focus", function(e) { log ("focus");})
.on("select2-blur", function(e) { log ("blur");});
$("#e11_2")
.on("change", function(e) { log("change "+JSON.stringify({val:e.val, added:e.added, removed:e.removed})); })
.on("opening", function() { log("opening"); })
.on("open", function() { log("open"); })
.on("close", function() { log("close"); })
.on("highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("selected", function(e) { log ("selected val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("loaded", function(e) { log ("loaded (data property omitted for brevitiy)");});
.on("select2-opening", function() { log("opening"); })
.on("select2-open", function() { log("open"); })
.on("select2-close", function() { log("close"); })
.on("select2-highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("select2-selecting", function(e) { log ("selecting val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("select2-removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));})
.on("select2-loaded", function(e) { log ("loaded (data property omitted for brevitiy)");})
.on("select2-focus", function(e) { log ("focus");})
.on("select2-blur", function(e) { log ("blur");});
});
</script>
<div class="span4">
@ -1605,7 +1609,7 @@ $("#select").select2({
</div>
<div class="row zebra">
<div class="span12">
<h3>opening</h3>
<h3>select2-opening</h3>
<p>Fired before the dropdown is shown.</p>
<p>The event listener can prevent the opening by calling <code>preventDefault()</code> on the supplied event object.</p>
</p>
@ -1613,14 +1617,14 @@ $("#select").select2({
</div>
<div class="row">
<div class="span12">
<h3>open</h3>
<h3>select2-open</h3>
<p>Fired after the dropdown is shown.</p>
</p>
</div>
</div>
<div class="row zebra">
<div class="span12">
<h3>highlight</h3>
<h3>select2-highlight</h3>
<p>Fired when a choice is highlighted in the dropdown.</p>
</p>
<p>The event object contains the following custom properties:
@ -1631,9 +1635,9 @@ $("#select").select2({
</p>
</div>
</div>
<div class="row zebra">
<div class="row">
<div class="span12">
<h3>select</h3>
<h3>select2-selecting</h3>
<p>Fired when a choice is being selected in the dropdown, but before any modification has been made to the selection.
This event is used to allow the user to reject selection by calling <code>event.preventDefault()</code></p>
</p>
@ -1645,22 +1649,9 @@ $("#select").select2({
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>selected</h3>
<p>Fired when a choice is selected in the dropdown.</p>
</p>
<p>The event object contains the following custom properties:
<dl>
<dt>val</dt><dd>the id of the highlighted choice object</dd>
<dt>object</dt><dd>the choice object that was selected</dd>
</dl>
</p>
</div>
</div>
<div class="row zebra">
<div class="span12">
<h3>removed</h3>
<h3>select2-removed</h3>
<p>Fired when a choice is removed or cleared</p>
</p>
<p>The event object contains the following custom properties:
@ -1673,7 +1664,7 @@ $("#select").select2({
</div>
<div class="row">
<div class="span12">
<h3>loaded</h3>
<h3>select2-loaded</h3>
<p>Fired when query function is done loading the data and the results list has been updated</p>
</p>
<p>The event object contains the following custom properties:
@ -1683,8 +1674,20 @@ $("#select").select2({
</p>
</div>
</div>
<div class="row zebra">
<div class="span12">
<h3>select2-focus</h3>
<p>Fired when the control is focussed
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>select2-blur</h3>
<p>Fired when the control is blurred
</p>
</div>
</div>
</section>
<div class="row">

@ -1 +1 @@
Subproject commit 55827b9159cca41c94c2a232f49943cef602e52b
Subproject commit d668ae76d01a7f5a27c38f123f4eed7cc8282c7c

View File

@ -8,12 +8,12 @@
</style>
</head>
<body>
<div style="height:200px;"></div>
<!-- <div style="height:200px;"></div> -->
<div style="padding: 10px; margin: 10px;">
<br/><br/><br/>
<input type="text" size="30"/><br/>
<label for="e4">Label: </label>
<select id="e4" style="width:300px" class="populate">
<select id="e4" style="width:300px" class="populate" autofocus>
<option></option>
<option value="AK">Alaska</option>
<option value="HI">Hawaii</option>
@ -23,8 +23,7 @@
<option value="WA">Washington</option>
</select><br/>
<input type="text" size="30"/><br/>
<select>
<option></option>
<select id="e5" style="width:300px" multiple>
<option value="AK">Alaska</option>
<option value="HI">Hawaii</option>
<option value="CA">California</option>
@ -32,8 +31,9 @@
<option value="OR">Oregon</option>
<option value="WA">Washington</option>
</select><br/>
<input type="text" size="30"/><br/>
<!--
<div class="a">INSIDE A</div>
<div class="b">INSIDE B<input type="text" value="hello" class="c"/></div>
<script>
@ -44,7 +44,7 @@
});
});
</script>
-->
</div>
<script>
@ -53,6 +53,7 @@
if (!state.id) return state.text; // optgroup
return "<img class='flag' src='images/flags/" + state.id.toLowerCase() + ".png'/>" + state.text;
}
$("#e5").select2();
$("#e4").select2({
formatResult: format,
formatSelection: format,
@ -161,6 +162,8 @@
window.setTimeout(update, 100);
};
update();
});
</script>