knockout.autocomplete
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -257,4 +257,4 @@ /*global ko, jQuery, define, document, window*/ | ||
function preventDefault(event) { | ||
if (event.preventDefault) event.preventDefault(); | ||
function preventDefault(e) { | ||
if (e.preventDefault) e.preventDefault(); | ||
return false; | ||
@@ -366,5 +366,5 @@ } | ||
$dropdown.on('mousedown', false); | ||
$dropdown.on('touchstart', 'li', function (event) { | ||
$dropdown.on('touchstart', 'li', function (e) { | ||
moves = 0; | ||
var $target = $(event.target); | ||
var $target = $(e.target); | ||
$highlightedElements = $target.closest('li'); | ||
@@ -377,13 +377,13 @@ $('li', $dropdown).removeClass('touching'); | ||
}, 50); | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); | ||
if (e.stopPropagation) { | ||
e.stopPropagation(); | ||
} | ||
return true; | ||
}); | ||
$dropdown.on('touchmove', 'li', function (event) { | ||
$dropdown.on('touchmove', 'li', function (e) { | ||
moves += 1; | ||
$highlightedElements.removeClass('touching'); | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); | ||
if (e.stopPropagation) { | ||
e.stopPropagation(); | ||
} | ||
@@ -393,3 +393,3 @@ | ||
}); | ||
$dropdown.on('touchend', 'li', function (event) { | ||
$dropdown.on('touchend', 'li', function (e) { | ||
setTimeout(function () { | ||
@@ -404,14 +404,14 @@ $highlightedElements.removeClass('touching'); | ||
var item = ko.dataFor(event.target); | ||
var item = ko.dataFor(e.target); | ||
selectItem(item.item); | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); | ||
if (e.stopPropagation) { | ||
e.stopPropagation(); | ||
} | ||
return preventDefault(event); | ||
return preventDefault(e); | ||
}); | ||
} else { | ||
$dropdown.on('mousedown', 'li', function (e) { | ||
if (event.type === 'mousedown' && event.which !== 1) { | ||
if (e.type === 'mousedown' && e.which !== 1) { | ||
return false; | ||
@@ -422,6 +422,6 @@ } | ||
selectItem(item.item); | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); | ||
if (e.stopPropagation) { | ||
e.stopPropagation(); | ||
} | ||
return preventDefault(event); | ||
return preventDefault(e); | ||
}); | ||
@@ -428,0 +428,0 @@ } |
{ | ||
"name": "knockout.autocomplete", | ||
"version": "0.0.1", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
"dependencies": {}, | ||
"scripts": { | ||
"test": "phantomjs vendor/mocha-phantomjs.coffee test/index.html" | ||
}, | ||
"devDependencies": { | ||
"phantomjs": "=0.0.8" | ||
} | ||
"name": "knockout.autocomplete", | ||
"version": "0.0.2", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
"dependencies": {}, | ||
"scripts": { | ||
"test": "phantomjs vendor/mocha-phantomjs.coffee test/index.html" | ||
}, | ||
"devDependencies": { | ||
"phantomjs": "=0.0.8" | ||
} | ||
} |
610913