<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" version="2.0">
  <channel>
    <title>Recent Posts in Dock | Prototype UI</title>
    <link>http://forums.prototype-ui.com/forums/4/posts</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <atom:link rel="search" type="application/opensearchdescription+xml" href="http://forums.prototype-ui.com/open_search.xml"/>
    <item>
      <title>Some basics about Dock replied by Uhu @ Thu, 11 Dec 2008 13:48:06 -0000</title>
      <description>&lt;p&gt;Hi&lt;/p&gt;


	&lt;p&gt;Am I right that Dock ist somehting like a Windowbar?&lt;br /&gt;Where do you hide it?&lt;/p&gt;


	&lt;p&gt;I&#180;ve searched all your downloads including the Docs.&lt;br /&gt;I didn&#180;t found something about&amp;#8230;&lt;/p&gt;


	&lt;p&gt;Please tell me more!&lt;/p&gt;


	&lt;p&gt;Kind regards&lt;/p&gt;


	&lt;p&gt;Uhu&lt;/p&gt;</description>
      <pubDate>Thu, 11 Dec 2008 13:48:06 -0000</pubDate>
      <guid isPermaLink="false">forums.prototype-ui.com:4:216:628</guid>
      <author>Uhu</author>
      <link>http://forums.prototype-ui.com/forums/4/topics/216</link>
    </item>
    <item>
      <title>added center option replied by johncarlson21 @ Fri, 21 Dec 2007 19:24:46 -0000</title>
      <description>&lt;p&gt;Hey everyone.. not sure if this will be useful to anyone but I added a bit of code to dock.js and prototype-ui.js to get my dock to center to the center of the window.. also I added a z-index of 999 to it so that it would stay above my windows and other content. Here it is.. :)&lt;/p&gt;


	&lt;p&gt;find this:
    // Property: labelsSelector
    //   &lt;span class="caps"&gt;CSS3&lt;/span&gt; selector to select labels element, default is &amp;#8221;.label&amp;#8221;.
    labelsSelector: &amp;#8217;.label&amp;#8217;&lt;/p&gt;


	&lt;p&gt;and change it to this:
    // Property: labelsSelector
    //   &lt;span class="caps"&gt;CSS3&lt;/span&gt; selector to select labels element, default is &amp;#8221;.label&amp;#8221;.
    labelsSelector: &amp;#8217;.label&amp;#8217;,&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;// Property: center
// a boolean, if set to true the dock is centered in the window
center: true&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;then find this:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;redrawItems: function(){
  var itemSize  = this.options.itemSize,
      maxSize   = this.options.maxItemSize,
      totalSize = 0;&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;this.items.each(function(item) {
  var size = itemSize + this.scale * (item.size - itemSize),
      image = item.image;
  image.setAttribute('width', size);
  image.setAttribute('height', size);
  image.style.marginTop = maxSize - size + 'px';
  if (item.label)
    item.label.style.width = size + 'px';
  totalSize += size;
}, this);&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;this.element.style.width = totalSize + 'px';&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;}&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;and change it to this:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;redrawItems: function(){
  var itemSize  = this.options.itemSize,
      maxSize   = this.options.maxItemSize,
      totalSize = 0;&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;this.items.each(function(item) {
  var size = itemSize + this.scale * (item.size - itemSize),
      image = item.image;
  image.setAttribute('width', size);
  image.setAttribute('height', size);
  image.style.marginTop = maxSize - size + 'px';
  if (item.label)
    item.label.style.width = size + 'px';
  totalSize += size;
}, this);&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;this.element.style.width = totalSize + 'px';
this.element.style.zIndex = 999;&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;// added by john carlson to center the dock in the window
if(this.options.center){
  myWidth = 0;
  myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &amp;#38;&amp;#38; ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body &amp;#38;&amp;#38; ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  } // end if
}
// end centered add&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;var nleft = (myWidth/2) - (totalSize/2)
this.element.style.left=nleft+"px";&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;}&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;notice the part that is commented&lt;/p&gt;


	&lt;p&gt;to use the center function just do this.&lt;/p&gt;


	&lt;p&gt;dock = new UI.Dock(&amp;#8216;dock&amp;#8217;,{center: true});&lt;/p&gt;


	&lt;p&gt;and there you go..&lt;/p&gt;


	&lt;p&gt;Here is another trick..&lt;/p&gt;


	&lt;p&gt;if you want to recenter it when the window is resized just do this:&lt;br /&gt;&amp;lt;body onresize="dock.redrawItems();"&gt;&lt;/p&gt;


	&lt;p&gt;Tested in FireFox!!!!!!!!!!&lt;/p&gt;


	&lt;p&gt;Hope this helps some people&lt;/p&gt;


	&lt;p&gt;John&lt;/p&gt;</description>
      <pubDate>Fri, 21 Dec 2007 19:24:46 -0000</pubDate>
      <guid isPermaLink="false">forums.prototype-ui.com:4:17:37</guid>
      <author>johncarlson21</author>
      <link>http://forums.prototype-ui.com/forums/4/topics/17</link>
    </item>
    <item>
      <title>getting the dock down :) replied by johncarlson21 @ Wed, 19 Dec 2007 22:33:53 -0000</title>
      <description>&lt;p&gt;I am playing with the code for the dock and I was wondering how to get it centered at the bottom of the page..&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve tried many examples from the web to get it bottom centered but I can&amp;#8217;t get it to go.. is it something with the floating left..&lt;/p&gt;


	&lt;p&gt;is there a fix for this..? what could I do..&lt;/p&gt;


	&lt;p&gt;also is there a way to put the labels above the icons?&lt;/p&gt;


	&lt;p&gt;thanks,&lt;br /&gt;John Carlson&lt;/p&gt;</description>
      <pubDate>Wed, 19 Dec 2007 22:33:53 -0000</pubDate>
      <guid isPermaLink="false">forums.prototype-ui.com:4:15:35</guid>
      <author>johncarlson21</author>
      <link>http://forums.prototype-ui.com/forums/4/topics/15</link>
    </item>
  </channel>
</rss>
