Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
v2.4.8, fix config bleeding into multiple instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Mobius1 committed Nov 21, 2018
1 parent a054c84 commit 6831dd2
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 156 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobius1-selectr",
"version": "2.4.7",
"version": "2.4.8",
"ignore": [
".gitattributes",
"README.md"
Expand Down
2 changes: 1 addition & 1 deletion dist/selectr.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 58 additions & 58 deletions dist/selectr.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobius1-selectr",
"version": "2.4.7",
"version": "2.4.8",
"description": "A lightweight, dependency-free, mobile-friendly javascript select box replacement.",
"main": "dist/selectr.min.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/selectr.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Selectr 2.4.7
* Selectr 2.4.8
* http://mobius.ovh/docs/selectr
*
* Released under the MIT license
Expand Down
186 changes: 92 additions & 94 deletions src/selectr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Selectr 2.4.7
* Selectr 2.4.8
* http://mobius.ovh/docs/selectr
*
* Released under the MIT license
Expand All @@ -17,97 +17,6 @@
}(this, function(plugin) {
'use strict';

/**
* Default configuration options
* @type {Object}
*/
var defaultConfig = {
/**
* Emulates browser behaviour by selecting the first option by default
* @type {Boolean}
*/
defaultSelected: true,

/**
* Sets the width of the container
* @type {String}
*/
width: "auto",

/**
* Enables/ disables the container
* @type {Boolean}
*/
disabled: false,

/**
* Enables / disables the search function
* @type {Boolean}
*/
searchable: true,

/**
* Enable disable the clear button
* @type {Boolean}
*/
clearable: false,

/**
* Sort the tags / multiselect options
* @type {Boolean}
*/
sortSelected: false,

/**
* Allow deselecting of select-one options
* @type {Boolean}
*/
allowDeselect: false,

/**
* Close the dropdown when scrolling (@AlexanderReiswich, #11)
* @type {Boolean}
*/
closeOnScroll: false,

/**
* Allow the use of the native dropdown (@jonnyscholes, #14)
* @type {Boolean}
*/
nativeDropdown: false,

/**
* Allow the use of native typing behavior for toggling, searching, selecting
* @type {boolean}
*/
nativeKeyboard: false,

/**
* Set the main placeholder
* @type {String}
*/
placeholder: "Select an option...",

/**
* Allow the tagging feature
* @type {Boolean}
*/
taggable: false,

/**
* Set the tag input placeholder (@labikmartin, #21, #22)
* @type {String}
*/
tagPlaceholder: "Enter a tag...",

messages: {
noResults: "No results.",
noOptions: "No options available.",
maxSelections: "A maximum of {max} items can be selected.",
tagDuplicate: "That tag is already in use.",
}
};

/**
* Event Emitter
*/
Expand Down Expand Up @@ -980,7 +889,96 @@
// Main Lib
var Selectr = function(el, config) {

config = config || {};
/**
* Default configuration options
* @type {Object}
*/
this.defaultConfig = {
/**
* Emulates browser behaviour by selecting the first option by default
* @type {Boolean}
*/
defaultSelected: true,

/**
* Sets the width of the container
* @type {String}
*/
width: "auto",

/**
* Enables/ disables the container
* @type {Boolean}
*/
disabled: false,

/**
* Enables / disables the search function
* @type {Boolean}
*/
searchable: true,

/**
* Enable disable the clear button
* @type {Boolean}
*/
clearable: false,

/**
* Sort the tags / multiselect options
* @type {Boolean}
*/
sortSelected: false,

/**
* Allow deselecting of select-one options
* @type {Boolean}
*/
allowDeselect: false,

/**
* Close the dropdown when scrolling (@AlexanderReiswich, #11)
* @type {Boolean}
*/
closeOnScroll: false,

/**
* Allow the use of the native dropdown (@jonnyscholes, #14)
* @type {Boolean}
*/
nativeDropdown: false,

/**
* Allow the use of native typing behavior for toggling, searching, selecting
* @type {boolean}
*/
nativeKeyboard: false,

/**
* Set the main placeholder
* @type {String}
*/
placeholder: "Select an option...",

/**
* Allow the tagging feature
* @type {Boolean}
*/
taggable: false,

/**
* Set the tag input placeholder (@labikmartin, #21, #22)
* @type {String}
*/
tagPlaceholder: "Enter a tag...",

messages: {
noResults: "No results.",
noOptions: "No options available.",
maxSelections: "A maximum of {max} items can be selected.",
tagDuplicate: "That tag is already in use.",
}
};

if (!el) {
throw new Error("You must supply either a HTMLSelectElement or a CSS3 selector string.");
Expand Down Expand Up @@ -1017,7 +1015,7 @@
this.el.selectr = this;

// Merge defaults with user set config
this.config = util.extend(defaultConfig, config);
this.config = util.extend(this.defaultConfig, config);

// Store type
this.originalType = this.el.type;
Expand Down

0 comments on commit 6831dd2

Please sign in to comment.