JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.6.1
[ckeditor.git] / _source / plugins / stylescombo / plugin.js
index 74dd0b7..b693ada 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -14,7 +14,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        var config = editor.config,\r
                                lang = editor.lang.stylesCombo,\r
                                styles = {},\r
-                               stylesList = [];\r
+                               stylesList = [],\r
+                               combo;\r
 \r
                        function loadStylesSet( callback )\r
                        {\r
@@ -62,7 +63,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                                        init : function()\r
                                        {\r
-                                               var combo = this;\r
+                                               combo = this;\r
 \r
                                                loadStylesSet( function()\r
                                                        {\r
@@ -95,7 +96,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                                                                combo.commit();\r
 \r
-                                                               combo.onOpen();\r
                                                        });\r
                                        },\r
 \r
@@ -181,6 +181,22 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                                                if ( !counter[ CKEDITOR.STYLE_OBJECT ] )\r
                                                        this.hideGroup( lang[ 'panelTitle' + String( CKEDITOR.STYLE_OBJECT ) ] );\r
+                                       },\r
+\r
+                                       // Force a reload of the data\r
+                                       reset: function()\r
+                                       {\r
+                                               if ( combo )\r
+                                               {\r
+                                                       delete combo._.panel;\r
+                                                       delete combo._.list;\r
+                                                       combo._.committed = 0;\r
+                                                       combo._.items = {};\r
+                                                       combo._.state = CKEDITOR.TRISTATE_OFF;\r
+                                               }\r
+                                               styles = {};\r
+                                               stylesList = [];\r
+                                               loadStylesSet();\r
                                        }\r
                                });\r
 \r