Permalink
Browse files

fix to issue #65 [#65 status:resolved]

  • Loading branch information...
1 parent 0047fb0 commit 9a6b6582f246a029ef206209c1ca075e6d4cd309 @jonlb jonlb committed Jan 8, 2012
Showing with 17 additions and 7 deletions.
  1. +11 −6 src/Source/Toolbar/container.js
  2. +1 −1 vendor/mootools-core
  3. +5 −0 www/reference/examples/toolbar.html
@@ -110,12 +110,14 @@ Jx.Toolbar.Container = new Class({
* template
*/
if (document.id(this.options.parent)) {
- this.domObj = document.id(this.options.parent);
this.elements = {
- 'jxBarContainer': this.domObj
+ 'jxBarContainer': document.id(this.options.parent)
};
+ var temp = this.domObj;
+ this.domObj = this.elements['jxBarContainer'];
this.domObj.addClass('jxBarContainer');
this.domObj.grab(this.controls);
+ temp.destroy();
this.domObj.addEvent('sizeChange', this.update);
}
@@ -199,6 +201,9 @@ Jx.Toolbar.Container = new Class({
this);
var scrollerSize = tbcSize;
+
+ //account for control size as we never hide it
+ scrollerSize -= this.controls.getMarginBoxSize().width;
if (s === 0) {
this.scrollLeft.setEnabled(false);
@@ -207,9 +212,7 @@ Jx.Toolbar.Container = new Class({
var leftMargin = this.wrapper.getStyle('margin-left').toInt();
- scrollerSize -= this.controls.getMarginBoxSize().width;
-
-
+
if (leftMargin < 0) {
//has been scrolled left so activate the right scroller
this.scrollLeft.setEnabled(true);
@@ -231,7 +234,9 @@ Jx.Toolbar.Container = new Class({
this.scrollRight.setEnabled(false);
this.scrollLeft.setEnabled(false);
}
- this.scroller.setStyle('width', scrollerSize - 1);
+ //due to rounding errors, we reduce by 3 just to make sure we leave
+ //ample room for the buttons to show
+ this.scroller.setStyle('width', ((scrollerSize <= 0)? 0:scrollerSize - 3));
this.findFirstVisible();
this.updating = false;
Submodule mootools-core updated 75 files
+3 −1 .gitignore
+4 −3 .gitmodules
+2 −0 Docs/Element/Element.Event.md
+2 −2 Docs/Element/Element.md
+5 −1 Docs/Request/Request.md
+0 −11 Source/Browser/Browser.js
+3 −3 Source/Core/Core.js
+19 −19 Source/Element/Element.Event.js
+62 −21 Source/Element/Element.js
+1 −0 Source/Fx/Fx.Tween.js
+2 −2 Source/Request/Request.js
+0 −1 Specs
+326 −0 Specs/1.2/Class/Class.Extras.js
+247 −0 Specs/1.2/Class/Class.js
+40 −0 Specs/1.2/Core/Browser.js
+418 −0 Specs/1.2/Core/Core.js
+69 −0 Specs/1.2/Core/Native.js
+134 −0 Specs/1.2/Element/Element.Dimensions.js
+87 −0 Specs/1.2/Element/Element.Style.js
+1,568 −0 Specs/1.2/Element/Element.js
+207 −0 Specs/1.2/Native/Array.js
+155 −0 Specs/1.2/Native/Function.js
+203 −0 Specs/1.2/Native/Hash.js
+114 −0 Specs/1.2/Native/Number.js
+158 −0 Specs/1.2/Native/String.js
+17 −0 Specs/1.2/Utilities/Cookie.js
+280 −0 Specs/1.3base/Class/Class.js
+480 −0 Specs/1.3base/Core/Core.js
+159 −0 Specs/1.3base/Fx/Fx.js
+271 −0 Specs/1.3base/Types/Array.js
+201 −0 Specs/1.3base/Types/Function.js
+128 −0 Specs/1.3base/Types/Object.js
+15 −0 Specs/1.3base/package.yml
+20 −0 Specs/1.3client/Browser/Browser.js
+183 −0 Specs/1.3client/Class/Class.Extras.js
+56 −0 Specs/1.3client/Core/Core.js
+86 −0 Specs/1.3client/Element/Element.Dimensions.js
+85 −0 Specs/1.3client/Element/Element.Event.js
+38 −0 Specs/1.3client/Element/Element.Style.js
+360 −0 Specs/1.3client/Element/Element.js
+32 −0 Specs/1.3client/Element/IFrame.js
+128 −0 Specs/1.3client/Element/NewElement.js
+58 −0 Specs/1.3client/Fx/Fx.Morph.js
+127 −0 Specs/1.3client/Fx/Fx.Tween.js
+254 −0 Specs/1.3client/Request/Request.HTML.js
+64 −0 Specs/1.3client/Request/Request.JSON.js
+140 −0 Specs/1.3client/Request/Request.js
+29 −0 Specs/1.3client/Types/Object.js
+25 −0 Specs/1.3client/Utilities/Cookie.js
+33 −0 Specs/1.3client/Utilities/DOMReady.js
+453 −0 Specs/1.3client/Utilities/DOMReady.php
+33 −0 Specs/1.3client/Utilities/JSON.js
+26 −0 Specs/1.3client/package.yml
+29 −0 Specs/1.4base/Types/Array.js
+32 −0 Specs/1.4base/Types/Function-nocompat.js
+268 −0 Specs/1.4client/Element/Element.Delegation.html
+58 −0 Specs/1.4client/Element/Element.Delegation.js
+131 −0 Specs/1.4client/Element/Element.Event.change.html
+85 −0 Specs/1.4client/Element/Element.Event.js
+224 −0 Specs/1.4client/Element/Element.js
+46 −0 Specs/1.4client/Fx/Fx.Tween.js
+10 −0 Specs/1.4client/package.yml
+572 −0 Specs/2.0base/Core/Core.js
+291 −0 Specs/2.0base/Types/Array.js
+232 −0 Specs/2.0base/Types/Function.js
+132 −0 Specs/2.0base/Types/Number.js
+176 −0 Specs/2.0base/Types/Object.js
+149 −0 Specs/2.0base/Types/String.js
+21 −0 Specs/2.0client/Browser/Browser.js
+341 −0 Specs/Configuration.js
+48 −0 Specs/README.md
+1 −0 Specs/Runner
+1 −0 Specs/buildMobile
+28 −0 Specs/index.html
+73 −0 developers.sh
@@ -14,13 +14,18 @@
vToolbar();
drawMultiToolbar();
drawAlignedToolbar();
+
+ //after everything fire a window resize event to ensure everything
+ //is drawn correctly.
+ window.fireEvent('resize');
});
if($(document).getElements('.tabContentActiveExamples').length > 0) {
$(document).getElements('.tabContentActiveExamples')[0].addEvent('loadAjax', function() {
hToolbar();
vToolbar();
drawMultiToolbar();
drawAlignedToolbar();
+ window.fireEvent('resize');
});
}
</script>

0 comments on commit 9a6b658

Please sign in to comment.