Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arale-autocomplete

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arale-autocomplete - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

examples/other.handlebars

8

examples/data-source.md

@@ -60,3 +60,3 @@ # 数据源

trigger: '#acTrigger3',
dataSource: function(value) {
dataSource: function(value, done) {
var that = this;

@@ -67,7 +67,5 @@ $.ajax('./data.json', {

.success(function(data) {
that.trigger('data', data.concat(local));
done(data.concat(local));
})
.error(function(data) {
that.trigger('data', {});
});
.error(done);
},

@@ -74,0 +72,0 @@ width: 150

@@ -45,3 +45,3 @@ # 其他示例

````javascript
seajs.use('../src/autocomplete.css');
seajs.use('select.css');
seajs.use(['autocomplete', './other.handlebars'], function(AutoComplete, template) {

@@ -51,3 +51,3 @@ ac = new AutoComplete({

template: template,
selectItem: false,
width: '200'
dataSource: [

@@ -54,0 +54,0 @@ '信用卡',

@@ -5,2 +5,10 @@ # History

## 1.4.1
`tag:fixed` 修复 for/in 数组的 bug
`tag:fixed` #98 模板中不应该使用 javascript:\'\'
`tag:fixed` _handleSelection 中 data 为空的情况
## 1.4.0

@@ -7,0 +15,0 @@

{
"name": "arale-autocomplete",
"version": "1.4.0",
"version": "1.4.1",
"description": "自动补全组件",

@@ -5,0 +5,0 @@ "keywords": [

@@ -30,3 +30,3 @@ var $ = require('spm-jquery');

return function () {
val.apply(that, arguments);
return val.apply(that, arguments);
};

@@ -243,2 +243,3 @@ }

_handleSelection: function (e) {
if (!this.items) return;
var isMouse = e ? e.type === 'click' : false;

@@ -249,3 +250,3 @@ var index = isMouse ? this.items.index(e.currentTarget) : this.get('selectedIndex');

if (index >= 0 && item) {
if (index >= 0 && item && data) {
this.input.setValue(data.label);

@@ -490,2 +491,2 @@ this.set('selectedIndex', index, {

return v;
}
}

@@ -97,3 +97,8 @@ var Base = require('arale-base');

func = this.get('source');
// 如果返回 false 可阻止执行
var data = func.call(this, query, done);
if (data) {
this._done(data);
}

@@ -103,6 +108,2 @@ function done(data) {

}
var data = func.call(this, query, done);
if (data) {
this._done(data);
}
}

@@ -121,2 +122,2 @@ });

});
}
}

@@ -30,3 +30,5 @@ var sinon = require('spm-sinon');

trigger: '#test',
dataSource: ['abc', 'abd', 'cbd']
dataSource: function() {
return ['abc', 'abd', 'cbd'];
}
}).render();

@@ -592,2 +594,11 @@

});
it('should not contain a #98', function() {
ac = new AutoComplete({
trigger: '#test',
dataSource: ['abc', 'abd', 'abe']
}).render();
ac.setInputValue('a');
expect(ac.items.eq(0).find('a')[0]).to.be(undefined);
});
});

@@ -594,0 +605,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc