This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Missing Ecmascript functions moved to /deps/ecmascript

  • Loading branch information...
pdanis committed Nov 4, 2012
1 parent c99eca9 commit 6f386ea1becc031e6267006bcea75e5e1cb98a72
Showing with 26 additions and 16 deletions.
  1. +2 −2 grunt.js
  2. +22 −0 src/deps/ecmascript/array.js
  3. +2 −14 src/ngx.js
View
@@ -17,7 +17,7 @@ module.exports = function(grunt) {
},
concat: {
dist: {
- src: ['<banner:meta.banner>', 'src/ngx.js', 'src/**/!(lang|test)/*.js', 'src/**/lang/*.js'],
+ src: ['<banner:meta.banner>', 'src/ngx.js', 'src/deps/**/*.js', 'src/modules/**/!(lang|test)/*.js', 'src/modules/**/lang/*.js'],
dest: 'dist/ngx.js'
}
},
@@ -55,7 +55,7 @@ module.exports = function(grunt) {
}
},
lint: {
- files: ['grunt.js', 'src/ngx.js', 'src/lang/*.js', 'src/modules/**/*.js']
+ files: ['grunt.js', 'src/ngx.js', 'src/modules/**/*.js']
},
watch: {
scripts: {
@@ -0,0 +1,22 @@
+/**
+ * Missing ECMAScript Array functions
+ */
+(function(Array) {
+ 'use strict';
+
+ if (!Array.prototype.indexOf) {
+ /**
+ * Searches the array for the specified item and returns its position
+ * @param search
+ * @return {Number}
+ */
+ Array.prototype.indexOf = function(search) {
+ for (var i = 0; i < this.length; i++) {
+ if (this[i] === search) {
+ return i;
+ }
+ }
+ return -1;
+ };
+ }
+})(window.Array);
View
@@ -1,4 +1,4 @@
-(function(angular, Array) {
+(function(angular) {
'use strict';
angular.module('ngx', [
@@ -30,16 +30,4 @@
'ngx.ui.wysiwyg'
]);
- // missing ECMAScript functions
- if (!Array.prototype.indexOf) {
- Array.prototype.indexOf = function(search) {
- for (var i = 0; i < this.length; i++) {
- if (this[i] === search) {
- return i;
- }
- }
- return -1;
- };
- }
-
-})(window.angular, Array);
+})(window.angular);

0 comments on commit 6f386ea

Please sign in to comment.