From 35c618d81ba3cc61cc03a68137a30a60f67f75df Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 17 May 2014 23:12:57 -0700 Subject: [PATCH] Model bind will trigger when typeahead is selected --- src/UI/Mixins/AsModelBoundView.js | 2 +- src/UI/Mixins/AutoComplete.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/UI/Mixins/AsModelBoundView.js b/src/UI/Mixins/AsModelBoundView.js index d35f8a5a0..be70ec65b 100644 --- a/src/UI/Mixins/AsModelBoundView.js +++ b/src/UI/Mixins/AsModelBoundView.js @@ -20,7 +20,7 @@ define( } var options = { - changeTriggers: {'': 'change', '[contenteditable]': 'blur', '[data-onkeyup]': 'keyup'} + changeTriggers: {'': 'change typeahead:selected typeahead:autocompleted', '[contenteditable]': 'blur', '[data-onkeyup]': 'keyup'} }; this._modelBinder.bind(this.model, this.el, null, options); diff --git a/src/UI/Mixins/AutoComplete.js b/src/UI/Mixins/AutoComplete.js index ee43962a8..a55dadfdc 100644 --- a/src/UI/Mixins/AutoComplete.js +++ b/src/UI/Mixins/AutoComplete.js @@ -2,9 +2,8 @@ define( [ 'jquery', - 'underscore', 'typeahead' - ], function ($, _) { + ], function ($) { $.fn.autoComplete = function (resource) { $(this).typeahead({