select2 didn't seem very easy to integrate - bailing out of this [skip ci]

This commit is contained in:
Kevin Ross 2016-05-05 16:52:29 -05:00
parent cc6a7cc7fa
commit 6dbfd97a11
5 changed files with 4 additions and 70 deletions

View File

@ -5,73 +5,8 @@ group: material-design
--- ---
{% callout warning %} {% callout warning %}
## **Heads up! DON'T even think about using this!** ## **Heads up! These need work!**
Development in progress, no promises this will work...ever...it may even simply be removed. Do you want to see something integrated (at least style wise)? Submit a PR!
{% endcallout %} {% endcallout %}
## Select2
To use Select2, you must first include the appropriate `select2.js`. See the [select2](https://github.com/select2/select2) project for more information
<!-- include master here for our samples -->
<script src="https://cdn.rawgit.com/select2/select2/master/dist/js/select2.full.js"> </script>
### Single select
<form>
<div class="form-group">
<label for="select-bmd" class="bmd-label-floating">Example BMD select</label>
<select class="form-control" id="select-bmd">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
</form>
{% example html %}
<form>
<div class="form-group">
<label for="single-select2" class="bmd-label-floating">Example select2</label>
<select class="form-control" id="single-select2">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
</form>
<script>
$(function() {
var $eventSelect = $('#single-select2')
$eventSelect.on("select2:open", function (e) { log("select2:open", e); });
$eventSelect.on("select2:close", function (e) { log("select2:close", e); });
$eventSelect.on("select2:select", function (e) { log("select2:select", e); });
$eventSelect.on("select2:unselect", function (e) { log("select2:unselect", e); });
$eventSelect.on("change", function (e) { log("change"); });
function log (name, evt) {
if (!evt) {
var args = "{}";
} else {
var args = JSON.stringify(evt.params, function (key, value) {
if (value && value.nodeName) return "[DOM node]";
if (value instanceof $.Event) return "[$.Event]";
return value;
});
}
console.debug(name + " -> ", args)
}
$('#single-select2').select2()
})
</script>
{% endexample %}

View File

@ -36,6 +36,7 @@ const rollupConfig = {
options: { options: {
moduleName: 'BMD', moduleName: 'BMD',
external: [ external: [
'jquery',
'anchor-js', 'anchor-js',
'clipboard' 'clipboard'
], ],

View File

@ -45,7 +45,6 @@
"gulp-pipeline": "^4.0.40", "gulp-pipeline": "^4.0.40",
"jquery": "^2.2", "jquery": "^2.2",
"moment": "^2.13.0", "moment": "^2.13.0",
"select2": "^4.0.2",
"tether": "^1.3.2" "tether": "^1.3.2"
}, },
"engines": { "engines": {

View File

@ -1,3 +1,3 @@
// External plugins // External plugins
@import "extensions/snackbarjs"; @import "extensions/snackbarjs";
@import "extensions/select2"; @import "extensions/selectize";

View File

@ -1 +0,0 @@
@import "select2/src/scss/core";