Handle options smarter by making the iframe a regular view.
authorJan Schneider <jan@horde.org>
Tue, 27 Oct 2009 22:40:45 +0000 (23:40 +0100)
committerJan Schneider <jan@horde.org>
Wed, 28 Oct 2009 14:54:20 +0000 (15:54 +0100)
kronolith/js/kronolith.js
kronolith/templates/index/index.inc
kronolith/themes/screen.css

index 0856d49..4cc12aa 100644 (file)
@@ -181,7 +181,7 @@ KronolithCore = {
         case 'year':
         case 'agenda':
         case 'tasks':
-            this.closeView();
+            this.closeView(loc);
             var locCap = loc.capitalize();
             $('kronolithNav' + locCap).addClassName('on');
 
@@ -324,10 +324,11 @@ KronolithCore = {
             break;
 
         case 'options':
-            this.closeView();
+            this.closeView('iframe');
             this.iframeContent(loc, Kronolith.conf.prefs_url);
             this.setTitle(Kronolith.text.prefs);
             this._addHistory(loc);
+            this.view = 'iframe';
             break;
         }
     },
@@ -435,17 +436,14 @@ KronolithCore = {
     /**
      * Closes the currently active view.
      */
-    closeView: function()
+    closeView: function(loc)
     {
         [ 'Day', 'Week', 'Month', 'Year', 'Tasks', 'Agenda' ].each(function(a) {
             $('kronolithNav' + a).removeClassName('on');
         });
-        if (this.view) {
+        if (this.view && this.view != loc) {
             $('kronolithView' + this.view.capitalize()).fade({ 'queue': 'end' });
         }
-        if ($('kronolithIframe').visible()) {
-            $('kronolithIframe').fade({ 'queue': 'end' });
-        }
     },
 
     /**
@@ -1748,11 +1746,11 @@ KronolithCore = {
         } else {
             var iframe = new Element('IFRAME', { 'id': 'kronolithIframe' + name, 'class': 'kronolithIframe', 'frameBorder': 0, 'src': loc });
             //this._resizeIE6Iframe(iframe);
-            $('kronolithIframe').insert(iframe);
+            $('kronolithViewIframe').insert(iframe);
         }
 
         this.view = null;
-        $('kronolithIframe').appear({ 'queue': 'end' });
+        $('kronolithViewIframe').appear({ 'queue': 'end' });
     },
 
     onResize: function(noupdate, nowait)
index ad9d69c..fb3a05d 100644 (file)
@@ -128,7 +128,7 @@ require dirname(__FILE__) . '/year.inc';
 require dirname(__FILE__) . '/tasks.inc';
 require dirname(__FILE__) . '/agenda.inc';
 ?>
-<div id="kronolithIframe" style="display:none"></div>
+<div id="kronolithViewIframe" style="display:none"></div>
 </div>
 <!-- end body -->
 
index 256448c..e2ffdde 100644 (file)
@@ -1129,6 +1129,16 @@ table.kronolithView td.kronolithToday {
     background: #fff;
 }
 */
+#kronolithViewIframe iframe {
+    position: absolute;
+    left: 0;
+    top: 0;
+    bottom: 0;
+    right: 0;
+    border: none;
+    width: 100%;
+    height: 100%;
+}
 
 /* Events */
 .kronolithEvent {
@@ -1203,18 +1213,6 @@ div.kronolithView div.kronolithViewBody div.kronolithRow div .kronolithEvent.kro
     overflow: hidden;
 }
 
-/* IFRAME */
-#kronolithIframe iframe {
-    position: absolute;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    right: 0;
-    border: none;
-    width: 100%;
-    height: 100%;
-}
-
 /* Tags */
 .panel-tags {
     margin-left: 10px;