Changeset 12034
- Timestamp:
- 01/14/08 21:32:50 (12 months ago)
- Location:
- dijit/branches/newlayout
- Files:
-
- 2 modified
-
layout/BorderContainer.js (modified) (4 diffs)
-
tests/layout/test_BorderContainer.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dijit/branches/newlayout/layout/BorderContainer.js
r12033 r12034 14 14 // Provides layout in 5 regions, a center and borders along its 4 sides. 15 15 // 16 // de tails16 // description 17 17 // 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. 21 21 // The outer size must be specified on the BorderContainer node. Width must be specified for the sides 22 22 // and height for the top and bottom. 23 23 // "left" and "right" may be used interchangably for "leading" and "trailing" except that those terms do 24 24 // 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. 25 26 // 26 27 // usage … … 39 40 design: "headline", 40 41 42 // liveSplitters: Boolean 43 // specifies whether splitters resize as you drag (true) or only upon mouseup (false) 41 44 liveSplitters: true, 42 45 43 // persist: Number or Date44 // Save splitter positions in a cookie. Persist is off (NaN) by default.45 persist: new Date(""), // NaN46 // persist: Boolean 47 // Save splitter positions in a cookie. 48 persist: false, // Boolean 46 49 47 50 postCreate: function(){ … … 320 323 321 324 this._cookieName = this.container.id + "_" + this.region; 322 if( !isNaN(this.container.persist)){325 if(this.container.persist){ 323 326 // restore old size 324 327 var persistSize = dojo.cookie(this._cookieName); … … 377 380 } 378 381 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"]); 382 384 } 383 385 }, -
dijit/branches/newlayout/tests/layout/test_BorderContainer.html
r12033 r12034 87 87 <p>Sidebar layout, liveSplitters: false, persist: 1 day</p> 88 88 89 <div dojoType="dijit.layout.BorderContainer" design="sidebar" liveSplitters="false" persist=" 1"89 <div dojoType="dijit.layout.BorderContainer" design="sidebar" liveSplitters="false" persist="true" 90 90 style="border: 20px solid black; width: 90%; height: 300px; padding: 10px;" 91 91 >