namespace('kivi', function(k){
+ "use strict";
+
k.CustomerVendorPicker = function($real, options) {
// short circuit in case someone double inits us
if ($real.data("customer_vendor_picker"))
if (state == STATES.PICKED) {
annotate_state();
return true
- } else if (state == STATES.UNDEFINED && $dummy.val() == '')
+ } else if (state == STATES.UNDEFINED && $dummy.val() === '')
set_item({})
else {
last_unverified_dummy = $dummy.val();
function annotate_state () {
if (state == STATES.PICKED)
$dummy.removeClass(STATES.UNDEFINED).addClass(STATES.PICKED);
- else if (state == STATES.UNDEFINED && $dummy.val() == '')
+ else if (state == STATES.UNDEFINED && $dummy.val() === '')
$dummy.removeClass(STATES.UNDEFINED).addClass(STATES.PICKED);
else {
last_unverified_dummy = $dummy.val();
annotate_state();
}
});
- };
+ }
$dummy.autocomplete({
source: function(req, rsp) {
$dummy.keydown(function(event){
if (event.which == KEY.ENTER || event.which == KEY.TAB) {
// if string is empty assume they want to delete
- if ($dummy.val() == '') {
+ if ($dummy.val() === '') {
set_item({});
return true;
} else if (state == STATES.PICKED) {