1
0
mirror of synced 2025-02-19 21:43:15 +03:00

catch up with master

This commit is contained in:
Igor Vaynberg 2013-02-05 15:24:44 -08:00
parent 8c60fec36f
commit f11f900485
4 changed files with 47 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en" xmlns="http://www.w3.org/1999/html">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{ page.title }}</title> <title>{{ page.title }}</title>
@ -142,7 +142,7 @@
</section> </section>
<hr/> <hr/>
<footer> <footer>
<p>Select2 is licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache Software Foundation License Version 2.0</a>. Coded by Igor Vaynberg.</p> <p>Select2 is licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache Software Foundation License Version 2.0</a> and <a href=="http://www.gnu.org/licenses/gpl-2.0.html">GPL Version 2.0</a>. Coded by Igor Vaynberg.</p>
</footer> </footer>
</div> <!-- /container --> </div> <!-- /container -->

View File

@ -37,7 +37,8 @@ function format(state) {
} }
$("#e4").select2({ $("#e4").select2({
formatResult: format, formatResult: format,
formatSelection: format formatSelection: format,
escapeMarkup: function(m) { return m; }
}); });
}); });
</script> </script>
@ -106,7 +107,8 @@ $("#e6").select2({
}, },
formatResult: movieFormatResult, // omitted for brevity, see the source of this page formatResult: movieFormatResult, // omitted for brevity, see the source of this page
formatSelection: movieFormatSelection, // omitted for brevity, see the source of this page formatSelection: movieFormatSelection, // omitted for brevity, see the source of this page
dropdownCssClass: "bigdrop" // apply css that makes the dropdown taller dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller
escapeMarkup: function (m) { return m; } // we do not want to escape markup since we are displaying html in results
}); });
}); });
</script> </script>
@ -137,7 +139,8 @@ $("#e7").select2({
}, },
formatResult: movieFormatResult, // omitted for brevity, see the source of this page formatResult: movieFormatResult, // omitted for brevity, see the source of this page
formatSelection: movieFormatSelection, // omitted for brevity, see the source of this page formatSelection: movieFormatSelection, // omitted for brevity, see the source of this page
dropdownCssClass: "bigdrop" // apply css that makes the dropdown taller dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller
escapeMarkup: function (m) { return m; } // we do not want to escape markup since we are displaying html in results
}); });
}); });
</script> </script>
@ -997,7 +1000,7 @@ $(document).ready(function () {
<p class="alert alert-info">Only applies to single-value select boxes</p> <p class="alert alert-info">Only applies to single-value select boxes</p>
</td> </td>
</tr> </tr>
<tr><td>maximumSelectionSize</td><td>int</td><td> <tr><td>maximumSelectionSize</td><td>int/function</td><td>
<p> <p>
The maximum number of items that can be selected in a multi-select control. If this number is less than 1 selection is not limited. The maximum number of items that can be selected in a multi-select control. If this number is less than 1 selection is not limited.
</p> </p>

@ -1 +1 @@
Subproject commit 8332d6a7e9bf61be710acad6b7bea32e540db105 Subproject commit e78dc69a6b8dcadf8c8919b039d7ad0b4e7a6970

37
select2-test.html Normal file
View File

@ -0,0 +1,37 @@
<html>
<head>
<script src="js/jquery-1.8.1.js"></script>
<script src="select2-master/select2.js"></script>
<link href="select2-master/select2.css" rel="stylesheet"/>
<style>img.flag { height: 10px; width: 15px; padding-right: 10px; }
</style>
</head>
<body>
<div style="padding: 10px; margin: 10px;">
<select id="e4" style="width:300px" class="populate">
<option value="AK">Alaska</option>
<option value="HI">Hawaii</option>
<option value="CA">California</option>
<option value="NV">Nevada</option>
<option value="OR">Oregon</option>
<option value="WA">Washington</option>
</select><br/>
</div>
<script>
$(document).ready(function() {
function format(state) {
if (!state.id) return state.text; // optgroup
return "<img class='flag' src='images/flags/" + state.id.toLowerCase() + ".png'/>" + state.text;
}
$("#e4").select2({
formatResult: format,
formatSelection: format
});
});
</script>
</body>
</html>