Changeset 12034

Show
Ignore:
Timestamp:
01/14/08 21:32:50 (12 months ago)
Author:
peller
Message:

Just use Boolean persist for now. Realized that Number or Date isn't possible in the parser, so the previous example was really coming through as expires: null, not expires: 1. expires: yyyy-mm-dd is funky but perhaps not really useful? Refs #5585

Location:
dijit/branches/newlayout
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dijit/branches/newlayout/layout/BorderContainer.js

    r12033 r12034  
    1414        //      Provides layout in 5 regions, a center and borders along its 4 sides. 
    1515        // 
    16         // details 
     16        // description 
    1717        //      A BorderContainer is a box with a specified size (like style="width: 500px; height: 500px;"), 
    18         //      that contains children widgets marked with "position" of "top", "bottom", "leading", "trailing", "center". 
    19         //  Children will be laid out inside the edges of the box with the remaining space left for the center. 
    20         //  Optional splitters may be specified on the edge widgets to make them resizable by the user. 
     18        //      that contains children widgets marked with "position" of "top", "bottom", "leading", "trailing", 
     19        // "left", "right", or "center".  Children along the edge will be laid out according to the width 
     20        //  or height dimensions specified in CSS, with the remaining space left for the center. 
    2121        //  The outer size must be specified on the BorderContainer node.  Width must be specified for the sides 
    2222        //  and height for the top and bottom. 
    2323        //  "left" and "right" may be used interchangably for "leading" and "trailing" except that those terms do 
    2424        //  not reflect the fact that they will be reversed in right-to-left environments. 
     25        //  Optional splitters may be specified on the edge widgets to make them resizable by the user. 
    2526        // 
    2627        // usage 
     
    3940        design: "headline", 
    4041 
     42        // liveSplitters: Boolean 
     43        //  specifies whether splitters resize as you drag (true) or only upon mouseup (false) 
    4144        liveSplitters: true, 
    4245 
    43         // persist: Number or Date 
    44         //              Save splitter positions in a cookie.  Persist is off (NaN) by default. 
    45         persist: new Date(""),  // NaN 
     46        // persist: Boolean 
     47        //              Save splitter positions in a cookie. 
     48        persist: false, // Boolean 
    4649 
    4750        postCreate: function(){ 
     
    320323 
    321324                this._cookieName = this.container.id + "_" + this.region; 
    322                 if(!isNaN(this.container.persist)){ 
     325                if(this.container.persist){ 
    323326                        // restore old size 
    324327                        var persistSize = dojo.cookie(this._cookieName); 
     
    377380                } 
    378381 
    379                 var expires = this.container.persist; 
    380                 if(!isNaN(expires)){ 
    381                         dojo.cookie(this._cookieName, this.child.domNode.style[this.horizontal ? "height" : "width"]/*this.domNode.style[this.region]*/, {expires: expires}); 
     382                if(this.container.persist){ 
     383                        dojo.cookie(this._cookieName, this.child.domNode.style[this.horizontal ? "height" : "width"]); 
    382384                } 
    383385        }, 
  • dijit/branches/newlayout/tests/layout/test_BorderContainer.html

    r12033 r12034  
    8787<p>Sidebar layout, liveSplitters: false, persist: 1 day</p> 
    8888 
    89 <div dojoType="dijit.layout.BorderContainer" design="sidebar" liveSplitters="false" persist="1" 
     89<div dojoType="dijit.layout.BorderContainer" design="sidebar" liveSplitters="false" persist="true" 
    9090        style="border: 20px solid black; width: 90%; height: 300px; padding: 10px;" 
    9191>