mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-21 06:08:40 +00:00
Fix #44
This commit is contained in:
parent
4f3e939800
commit
0803dc1133
|
|
@ -151,7 +151,31 @@
|
|||
canvas = form.getElementsByTagName('canvas'),
|
||||
external = document.querySelectorAll('[form=' + this.id + ']');
|
||||
|
||||
return Array.prototype.slice.call(inputs).concat(Array.prototype.slice.call(selects), Array.prototype.slice.call(textareas), Array.prototype.slice.call(external));
|
||||
return this.getUniqueFormElements(
|
||||
Array.prototype.slice.call(inputs).concat(
|
||||
Array.prototype.slice.call(selects),
|
||||
Array.prototype.slice.call(textareas),
|
||||
Array.prototype.slice.call(external)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get unique form elements
|
||||
*
|
||||
* @param {Array} arr Form element array
|
||||
*
|
||||
* @return {Array}
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Views.FormView.prototype.getUniqueFormElements = function (arr)
|
||||
{
|
||||
let seen = {};
|
||||
|
||||
return arr.filter(function(item) {
|
||||
return seen.hasOwnProperty(item.name) ? false : (seen[item.name] = true);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user