8
0
Просмотр исходного кода

Override CKEDITOR.define so it fills CKEDITOR._dependencies.

fredck 10 лет назад
Родитель
Сommit
314545b135
1 измененных файлов с 14 добавлено и 1 удалено
  1. 14 1
      ckeditor.js

+ 14 - 1
ckeditor.js

@@ -20,6 +20,12 @@
 		 */
 		_getBasePath: getBasePath,
 
+		/**
+		 * The list of dependencies of **named** AMD modules created with `CKEDITOR.define`. This is mainly used to
+		 * trace the dependency tree of plugins.
+		 */
+		_dependencies: {},
+
 		/**
 		 * The full URL for the CKEditor installation directory.
 		 *
@@ -40,7 +46,14 @@
 		 * @method
 		 * @member CKEDITOR
 		 */
-		define: define,
+		define: function( name, deps ) {
+			// If this is a named module with dependencies, save this in the dependency list.
+			if ( Array.isArray( deps ) && name && !this._dependencies[ name ] ) {
+				this._dependencies[ name ] = deps;
+			}
+
+			return define.apply( this, arguments );
+		},
 
 		/**
 		 * Retrieves one or more AMD modules.