svn: /web/doc-editor/trunk/js/ui/component/ FilePanel.js

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Fri, 23 Apr 2010 17:21:57 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=298388

Log:
Exit when we are into a readOnly file

Changed paths:
    U   web/doc-editor/trunk/js/ui/component/FilePanel.js

Modified: web/doc-editor/trunk/js/ui/component/FilePanel.js
===================================================================
--- web/doc-editor/trunk/js/ui/component/FilePanel.js	2010-04-23 17:21:00 UTC (rev 298387)
+++ web/doc-editor/trunk/js/ui/component/FilePanel.js	2010-04-23 17:21:57 UTC (rev 298388)
@@ -878,6 +878,10 @@

                     coderestored : function()
                     {
+                        // This should never occurs on readOnly file
+                        if( this.readOnly ) {
+                            return;
+                        }

                         if ( Ext.getCmp(id_prefix + '-FILE-' + this.fid).isModified ) {
                             // Remove [modified] in title
@@ -907,7 +911,7 @@
                             }

                             // Desactivate save button
-                            if ( ! this.isPatch ) {
+                            if ( !this.isPatch ) {
                                 Ext.getCmp(id_prefix + '-FILE-' + this.fid + '-btn-save').disable();
                                 Ext.getCmp(id_prefix + '-FILE-' + this.fid + '-btn-saveas').disable();
                             }
@@ -919,6 +923,10 @@

                     codemodified : function()
                     {
+                        // This should never occurs on readOnly file
+                        if( this.readOnly ) {
+                            return;
+                        }

                         var cmpFile  = Ext.getCmp(id_prefix + '-FILE-' + this.fid),
                             cmpPanel = Ext.getCmp(id_prefix + '-PANEL-' + this.fid);
@@ -939,7 +947,7 @@
                             );

                             // Activate save button
-                            if (! this.isPatch)
+                            if ( !this.isPatch )
                             {
                                 Ext.getCmp(id_prefix + '-FILE-' + this.fid + '-btn-save').enable();
                                 Ext.getCmp(id_prefix + '-FILE-' + this.fid + '-btn-saveas').enable();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.