diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-08-19 18:52:21 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-08-19 18:52:21 -0500 |
commit | cf8efb462ea2aa909e9cb7e1118c160db1486949 (patch) | |
tree | 98ec6298038f7d22776554062b238f7df912d124 | |
parent | 255dbb3228d55dae62ba7c1862f963ec76cd4b85 (diff) | |
download | gitlab-ce-cf8efb462ea2aa909e9cb7e1118c160db1486949.tar.gz |
Use typeof instead of Underscore method
-rw-r--r-- | app/assets/javascripts/gl_dropdown.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js index b7f27085b4f..3f5c8359c22 100644 --- a/app/assets/javascripts/gl_dropdown.js +++ b/app/assets/javascripts/gl_dropdown.js @@ -470,7 +470,7 @@ } else { if (!selected) { value = this.options.id ? this.options.id(data) : data.id; - fieldName = _.isFunction(this.options.fieldName) ? this.options.fieldName() : this.options.fieldName; + fieldName = typeof this.options.fieldName === 'function' ? this.options.fieldName() : this.options.fieldName; field = this.dropdown.parent().find("input[name='" + fieldName + "'][value='" + value + "']"); if (field.length) { @@ -545,7 +545,7 @@ selectedObject = this.renderedData[selectedIndex]; } } - fieldName = _.isFunction(this.options.fieldName) ? this.options.fieldName(selectedObject) : this.options.fieldName; + fieldName = typeof this.options.fieldName === 'function' ? this.options.fieldName(selectedObject) : this.options.fieldName; value = this.options.id ? this.options.id(selectedObject, el) : selectedObject.id; if (isInput) { field = $(this.el); |