Skip to content

Commit 88b5f0f

Browse files
author
kaptinlin
committed
Release v0.2.2
1 parent 8327104 commit 88b5f0f

File tree

14 files changed

+54
-55
lines changed

14 files changed

+54
-55
lines changed

.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ rules:
6060
# Best Practices
6161
accessor-pairs: "error"
6262
block-scoped-var: "error"
63-
consistent-return: "error"
63+
consistent-return: "off"
6464
curly: "error"
6565
default-case: "error"
6666
dot-location: "off"

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ bower install jquery-asSelect --save
4646
npm install jquery-asSelect --save
4747
```
4848

49+
#### Install From Yarn
50+
```sh
51+
yarn add jquery-asSelect
52+
```
53+
4954
#### Build From Source
5055
If you want build from source:
5156

@@ -136,11 +141,11 @@ You can also save the instances to variable for further use.
136141

137142
```javascript
138143
// call directly
139-
$().asSelect('destory');
144+
$().asSelect('destroy');
140145

141146
// or
142147
var api = $().data('asSelect');
143-
api.destory();
148+
api.destroy();
144149
```
145150

146151
#### show()

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-asSelect",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "A jquery plugin that make a select more functional.",
55
"main": "dist/jquery-asSelect.js",
66
"copyright": "amazingSurge",

dist/css/asSelect.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* jQuery asSelect v0.2.1
2+
* jQuery asSelect v0.2.2
33
* https://github.com/amazingSurge/jquery-asSelect
44
*
55
* Copyright (c) amazingSurge

dist/css/asSelect.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery-asSelect.es.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* jQuery asSelect v0.2.1
2+
* jQuery asSelect v0.2.2
33
* https://github.com/amazingSurge/jquery-asSelect
44
*
55
* Copyright (c) amazingSurge
@@ -51,7 +51,7 @@ class asSelect {
5151
// options
5252
const metas = [];
5353
$.each(this.$select.data(), (k, v) => {
54-
const re = new RegExp("^asSelect", "i");
54+
const re = new RegExp(`^${NAMESPACE$1}`, "i");
5555
if (re.test(k)) {
5656
metas[k.toLowerCase().replace(re, '')] = v;
5757
}
@@ -140,7 +140,7 @@ class asSelect {
140140
}
141141

142142
_trigger(eventType, ...params) {
143-
let data = [this].concat(...params);
143+
let data = [this].concat(params);
144144

145145
// event
146146
this.$select.trigger(`${NAMESPACE$1}::${eventType}`, data);
@@ -152,7 +152,7 @@ class asSelect {
152152
let onFunction = `on${eventType}`;
153153

154154
if (typeof this.options[onFunction] === 'function') {
155-
this.options[onFunction].apply(this, ...params);
155+
this.options[onFunction].apply(this, params);
156156
}
157157
}
158158

@@ -332,7 +332,7 @@ class asSelect {
332332

333333
if (this.last !== this.currentIndex) {
334334
// pass source data object
335-
this._trigger('change', [this.getCurrentData(index).value]);
335+
this._trigger('change', this.getCurrentData(index).value);
336336
}
337337
}
338338

@@ -644,13 +644,13 @@ class asSelect {
644644
}
645645

646646
var info = {
647-
version:'0.2.1'
647+
version:'0.2.2'
648648
};
649649

650650
const NAMESPACE = 'asSelect';
651-
const OtherAsScrollbar = $.fn.asSelect;
651+
const OtherAsSelect = $.fn.asSelect;
652652

653-
const jQueryasSelect = function(options, ...args) {
653+
const jQueryAsSelect = function(options, ...args) {
654654
if (typeof options === 'string') {
655655
const method = options;
656656

@@ -678,12 +678,12 @@ const jQueryasSelect = function(options, ...args) {
678678
});
679679
};
680680

681-
$.fn.asSelect = jQueryasSelect;
681+
$.fn.asSelect = jQueryAsSelect;
682682

683683
$.asSelect = $.extend({
684684
setDefaults: asSelect.setDefaults,
685685
noConflict: function() {
686-
$.fn.asSelect = OtherAsScrollbar;
687-
return jQueryasSelect;
686+
$.fn.asSelect = OtherAsSelect;
687+
return jQueryAsSelect;
688688
}
689689
}, info);

dist/jquery-asSelect.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* jQuery asSelect v0.2.1
2+
* jQuery asSelect v0.2.2
33
* https://github.com/amazingSurge/jquery-asSelect
44
*
55
* Copyright (c) amazingSurge
@@ -124,7 +124,7 @@
124124
_jquery2.default.each(this.$select.data(),
125125

126126
function(k, v) {
127-
var re = new RegExp("^asSelect", "i");
127+
var re = new RegExp('^' + NAMESPACE$1, "i");
128128

129129
if (re.test(k)) {
130130
metas[k.toLowerCase().replace(re, '')] = v;
@@ -218,13 +218,11 @@
218218
}, {
219219
key: '_trigger',
220220
value: function _trigger(eventType) {
221-
var _ref;
222-
223221
for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
224222
params[_key - 1] = arguments[_key];
225223
}
226224

227-
var data = (_ref = [this]).concat.apply(_ref, params);
225+
var data = [this].concat(params);
228226

229227
// event
230228
this.$select.trigger(NAMESPACE$1 + '::' + eventType, data);
@@ -239,9 +237,7 @@
239237
var onFunction = 'on' + eventType;
240238

241239
if (typeof this.options[onFunction] === 'function') {
242-
var _options$onFunction;
243-
244-
(_options$onFunction = this.options[onFunction]).apply.apply(_options$onFunction, [this].concat(params));
240+
this.options[onFunction].apply(this, params);
245241
}
246242
}
247243
}, {
@@ -471,7 +467,7 @@
471467

472468
if (this.last !== this.currentIndex) {
473469
// pass source data object
474-
this._trigger('change', [this.getCurrentData(index).value]);
470+
this._trigger('change', this.getCurrentData(index).value);
475471
}
476472
}
477473
}, {
@@ -902,13 +898,13 @@
902898
}();
903899

904900
var info = {
905-
version: '0.2.1'
901+
version: '0.2.2'
906902
};
907903

908904
var NAMESPACE = 'asSelect';
909-
var OtherAsScrollbar = _jquery2.default.fn.asSelect;
905+
var OtherAsSelect = _jquery2.default.fn.asSelect;
910906

911-
var jQueryasSelect = function jQueryasSelect(options) {
907+
var jQueryAsSelect = function jQueryAsSelect(options) {
912908
var _this3 = this;
913909

914910
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
@@ -965,14 +961,14 @@
965961
);
966962
};
967963

968-
_jquery2.default.fn.asSelect = jQueryasSelect;
964+
_jquery2.default.fn.asSelect = jQueryAsSelect;
969965

970966
_jquery2.default.asSelect = _jquery2.default.extend({
971967
setDefaults: asSelect.setDefaults,
972968
noConflict: function noConflict() {
973-
_jquery2.default.fn.asSelect = OtherAsScrollbar;
969+
_jquery2.default.fn.asSelect = OtherAsSelect;
974970

975-
return jQueryasSelect;
971+
return jQueryAsSelect;
976972
}
977973
}, info);
978974
}

dist/jquery-asSelect.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/index.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,28 +142,27 @@ <h4>Default</h4>
142142
skin: 'simple',
143143
offset: [0, 0],
144144
});
145-
$('.custom-select').on('asSelect::trigger', function(event, data) {
145+
$('.custom-select').on('asSelect::trigger', function(event, api) {
146146
var text = event.type + ': triggered';
147147
$('<div>' + text + '</div>').prependTo($('.consoleEvent'));
148148
});
149-
$('.custom-select').on('asSelect::change', function(event, data) {
150-
console.log(data)
151-
var text = event.type + ': triggered;' + ' value: ' + data.value;
149+
$('.custom-select').on('asSelect::change', function(event, api, value) {
150+
var text = event.type + ': triggered;' + ' value: ' + value;
152151
$('<div>' + text + '</div>').prependTo($('.consoleEvent'));
153152
});
154-
$('.custom-select').on('asSelect::open', function(event, data) {
153+
$('.custom-select').on('asSelect::open', function(event, api) {
155154
var text = event.type + ': triggered';
156155
$('<div>' + text + '</div>').prependTo($('.consoleEvent'));
157156
});
158-
$('.custom-select').on('asSelect::close', function(event, data) {
157+
$('.custom-select').on('asSelect::close', function(event, api) {
159158
var text = event.type + ': triggered';
160159
$('<div>' + text + '</div>').prependTo($('.consoleEvent'));
161160
});
162-
$('.custom-select').on('asSelect::option::mouseenter', function(event, data) {
161+
$('.custom-select').on('asSelect::option::mouseenter', function(event, api) {
163162
var text = event.type + ': triggered';
164163
$('<div>' + text + '</div>').prependTo($('.consoleEvent'));
165164
});
166-
$('.custom-select').on('asSelect::option::mouseleave', function(event, data) {
165+
$('.custom-select').on('asSelect::option::mouseleave', function(event, api) {
167166
var text = event.type + ': triggered';
168167
$('<div>' + text + '</div>').prependTo($('.consoleEvent'));
169168
});

gulp/tasks/assets.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import config from '../../config';
44
import merge from 'merge-stream';
5-
import gulp from 'gulp';
6-
import browser from 'browser-sync';
5+
import gulp from 'gulp';this
76
import notify from 'gulp-notify';
87
import AssetsManager from 'assets-manager';
98
import argv from 'argv';

0 commit comments

Comments
 (0)