Author: ygrego Date: 2015-04-07 14:04:45 +0000 (Tue, 07 Apr 2015) New Revision: 1091 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1091 Log: New method "isPresent" has been added to namespace "oipf.utils". Modified: oipf/js/utils/Utils.js Modified: oipf/js/utils/Utils.js =================================================================== --- oipf/js/utils/Utils.js 2015-04-07 13:35:43 UTC (rev 1090) +++ oipf/js/utils/Utils.js 2015-04-07 14:04:45 UTC (rev 1091) @@ -43,6 +43,15 @@ return Math.floor(Math.random() * 9000) + 1000; }; +oipf.utils.isPresent = function(list, element) { + + for (var i = 0, l = list.length; i < l; i++) { + if (oipf.utils.equals(list[i], element)) { + return true; + } + } +}; + function createUUID() { // http://www.ietf.org/rfc/rfc4122.txt var s = [];