浏览代码

Updated inputData.js

Nadim Afana 9 年之前
父节点
当前提交
76298267f9
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      src/js/select2/compat/inputData.js

+ 5 - 4
src/js/select2/compat/inputData.js

@@ -1,6 +1,7 @@
 define([
-  'jquery'
-], function ($) {
+  'jquery',
+  '../utils'
+], function ($, Utils) {
   function InputData (decorated, $element, options) {
     this._currentData = [];
     this._valueSeparator = options.get('valueSeparator') || ',';
@@ -116,8 +117,8 @@ define([
   };
 
   InputData.prototype.addOptions = function (_, $options) {
-    var options = $.map($options, function ($option) {
-      return $.data($option[0], 'data');
+    var options = $.map($options, function ($option) {      
+	  return Utils.GetData($option[0], 'data');
     });
 
     this._currentData.push.apply(this._currentData, options);