Subversion Repositories SmartDukaan

Rev

Rev 14218 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14218 Rev 14345
Line 340... Line 340...
340
                i = $(that.options.item).attr('data-value', item[that.options.val]);
340
                i = $(that.options.item).attr('data-value', item[that.options.val]);
341
                i.find('a').html(that.highlighter(item[that.options.display], item));
341
                i.find('a').html(that.highlighter(item[that.options.display], item));
342
                return i[0];
342
                return i[0];
343
            });
343
            });
344
 
344
 
345
            items.first().addClass('active');
345
            // items.first().addClass('active');
346
            this.$menu.html(items);
346
            this.$menu.html(items);
347
            return this;
347
            return this;
348
        },
348
        },
349
 
349
 
350
        //------------------------------------------------------------------
350
        //------------------------------------------------------------------
351
        //
351
        //
352
        //  Item is selected
352
        //  Item is selected
353
        //
353
        //
354
        select: function () {
354
        select: function () {
355
            var $selectedItem = this.$menu.find('.active');
355
            var $selectedItem = this.$menu.find('.active');
-
 
356
            var val = this.$menu.find('.active').attr('data-value');
-
 
357
            if (val) {                
356
            this.$element.val($selectedItem.text()).change();
358
                this.$element.val($selectedItem.text()).change();
357
            this.options.itemSelected($selectedItem, $selectedItem.attr('data-value'), $selectedItem.text());
359
                this.options.itemSelected($selectedItem, $selectedItem.attr('data-value'), $selectedItem.text());
-
 
360
            }            
-
 
361
            $('form.navbar-form').submit();
358
            return this.hide();
362
            return this.hide();            
359
        },
363
        },
360
 
364
 
361
        //------------------------------------------------------------------
365
        //------------------------------------------------------------------
362
        //
366
        //
363
        //  Selects the next result
367
        //  Selects the next result