Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jupiterjs/mxui
Browse files Browse the repository at this point in the history
  • Loading branch information
amcdnl committed Apr 17, 2012
2 parents 9394d62 + 3f34264 commit 3ed6e37
Show file tree
Hide file tree
Showing 30 changed files with 344 additions and 661 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
84 changes: 0 additions & 84 deletions grid.html

This file was deleted.

406 changes: 0 additions & 406 deletions jquery-ui-1.7.2.custom.css

This file was deleted.

1 change: 1 addition & 0 deletions layout/modal/modal.js
Expand Up @@ -102,6 +102,7 @@ steal('jquery/controller', 'jquery/event/resize', 'mxui/layout/positionable', '.
my: 'center center',
at: 'center center',
of: window,
collision: 'fit fit',
// destroy modal when hide is triggered
destroyOnHide : false,
// show overlay if true
Expand Down
33 changes: 18 additions & 15 deletions layout/split/split.js
Expand Up @@ -710,23 +710,26 @@ function( $ ) {
}
}

if ( animate && !this.usingAbsPos ) {
$c.animate(dim, "fast", function() {
if ( resizePanels ) {
$(this).trigger('resize', [false]);
}
// Only resize panels that are actually visible, otherwise leave the dimensions of the panel alone
if ($c.is(':visible')) {
if ( animate && !this.usingAbsPos ) {
$c.animate(dim, "fast", function() {
if ( resizePanels ) {
$(this).trigger('resize', [false]);
}

if ( keep && !keepSized ) {
keep.trigger('resize', [false])
keepSized = true;
}
});
}
else {
$c.outerHeight(dim.outerHeight).outerWidth(dim.outerWidth);

if ( keep && !keepSized ) {
keep.trigger('resize', [false])
keepSized = true;
if ( resizePanels ) {
$c.trigger('resize', [false]);
}
});
}
else {
$c.outerHeight(dim.outerHeight).outerWidth(dim.outerWidth);

if ( resizePanels ) {
$c.trigger('resize', [false]);
}
}

Expand Down
102 changes: 54 additions & 48 deletions layout/split/split_test.js
@@ -1,26 +1,26 @@
steal('funcunit').then(function(){

module("MXUI.Layout.Split", {
module("MXUI.Layout.Split", {
setup: function(){
S.open("//mxui/layout/split/split.html");
S('.mxui_layout_split').exists();
S.wait(10); // so things can get settled ...
}
});

var verticalTest = function(name, container, num){


test("vertical "+name+" add / remove panel", function(){
var lastWidth = S(container+' .panel:eq(2)').width();


S('.add:visible:eq('+num+")").click();
S(container).find('.add').exists();
S(container+' .add').width(150, function(){
ok(true, "we keep original width of inserted")
})

S('.remove:visible:eq('+num+")").click();
S(container+' .add').missing();
S(container+' .panel:eq(2)').width(function(width){
Expand All @@ -29,45 +29,51 @@ steal('funcunit').then(function(){
ok(true, "set back to original width " + lastWidth)
})
});

test("vertical "+name+" resize parent", function(){
//make sure panels resize proportionally
var widths, heights;
S(container+' .panel:eq(2)').visible(function(){
widths = [S(container+' .panel:eq(0)').width(),
S(container+' .panel:eq(1)').width(),
widths = [S(container+' .panel:eq(0)').width(),
S(container+' .panel:eq(1)').width(),
S(container+' .panel:eq(2)').width()];
heights = [S(container+' .panel:eq(0)').height(),
S(container+' .panel:eq(1)').height(),
heights = [S(container+' .panel:eq(0)').height(),
S(container+' .panel:eq(1)').height(),
S(container+' .panel:eq(2)').height()];
})

S('.ui-resizable-e:eq('+num+")").drag("+60 +0", function(){

for (var i = 0; i < widths.length; i++) {
var width = S(container+' .panel:eq(' + i + ')').width()
ok(Math.abs(width - widths[i] - 20) <= 5, "widths about equal " + width + "," + widths[i] + " " + Math.abs(width - widths[i] - 20))
}


S('.ui-resizable-e:eq('+num+")").drag("+60 +0").then(function() {
S(container+' .panel:eq(0)').width(function(currentWidth) {
return Math.abs(currentWidth - widths[0] - 20) <= 5;
}, 'Widths about equal');
S(container+' .panel:eq(1)').width(function(currentWidth) {
return Math.abs(currentWidth - widths[1] - 20) <= 5;
}, 'Widths about equal');
S(container+' .panel:eq(2)').width(function(currentWidth) {
return Math.abs(currentWidth - widths[2] - 20) <= 5;
}, 'Widths about equal');
});

// make sure the heights go up (there are a few pixels of 'fuzz' )
S('.ui-resizable-s:eq('+num+")").drag("+0 +23", function(){

for (var i = 0; i < heights.length; i++) {
var height = S(container+' .panel:eq(' + i + ')').height()
equals(height, heights[i] + 23, "heights set " + height + "," + heights[i])
}

})

S('.ui-resizable-s:eq('+num+")").drag("+0 +23").then(function(){
S(container+' .panel:eq(0)').height(function(currentHeight) {
return currentHeight === heights[0] + 23;
}, 'Height properly set');
S(container+' .panel:eq(1)').height(function(currentHeight) {
return currentHeight === heights[1] + 23;
}, 'Height properly set');
S(container+' .panel:eq(2)').height(function(currentHeight) {
return currentHeight === heights[2] + 23;
}, 'Height properly set');
});

});

test("vertical "+name+" collapse and expand", function(){
var widths, left, right;
S(container+' .panel:eq(2)').visible(function(){
widths = [S(container+' .panel:eq(0)').width(),
S(container+' .panel:eq(1)').width(),
widths = [S(container+' .panel:eq(0)').width(),
S(container+' .panel:eq(1)').width(),
S(container+' .panel:eq(2)').width()];
})
S(container+' .collapser').click(function(){
Expand All @@ -78,21 +84,21 @@ steal('funcunit').then(function(){
ok(Math.abs(widths[1] + widths[2] / 2 - right) <= 3, "right consumes ");
});
// make sure they fill in about equal ..

S(container+' .collapser').click(function(){
var width2 = [S(container+' .panel:eq(0)').width(),
S(container+' .panel:eq(1)').width(),
var width2 = [S(container+' .panel:eq(0)').width(),
S(container+' .panel:eq(1)').width(),
S(container+' .panel:eq(2)').width()]
for (var i = 0; i < widths.length; i++) {
ok(Math.abs(widths[i] - width2[i]) <= 3, " " + i + " panel about equal");
}
});
})

};
verticalTest("floating","#container", 0);
verticalTest("absolute","#container2", 1);

test("vertical absolute - second splitter position",function(){
S('#container2 .splitter:eq(1)').visible(function(){
var second = S('#container2 .panel:eq(1)'),
Expand All @@ -101,7 +107,7 @@ steal('funcunit').then(function(){
equals(S('#container2 .splitter:eq(1)').offset().left, offset.left+outer, "right position");
})
});

test("panel keeps min width when resized", function(){
S('#container_min_width').visible(function(){
S('#container_min_width .splitter:first').drag('-500 +0', function(){
Expand All @@ -110,7 +116,7 @@ steal('funcunit').then(function(){
});
});
});

test("panel keeps min width when container resized", function(){
S('#container_min_width').visible(function(){
S('#container_min_width .ui-resizable-e').drag('-1000 +0', function(){
Expand All @@ -119,35 +125,35 @@ steal('funcunit').then(function(){
});
});
});

/*
test("Remove Panel",function(){
test("Remove Panel",function(){
S('#remove').click().wait(2000,function(){
equal(S('#container').find('.panel:visible').size(), 2);
});
});
test("Resize Panels",function(){
var container = S('#container');
var firstPanel = container.find('.panel:eq(0)');
var prevWidth = firstPanel.width();
container.find('.splitter:eq(0)').drag('+10 0').wait(1000,function(){
equal(firstPanel.width() != prevWidth, true);
});
});
test("Hide Last",function(){
test("Hide Last",function(){
S('#hide').click().wait(1000,function(){
S('#container').find('.panel:last').invisible()
});
});
test("Collaspe Panel",function(){
S('#container').find('.right-collaspe').click().wait(1000,function(){
S('#container').find('.panel:last').invisible();
});
});*/
});
Binary file removed smoothness/images/ui-bg_glass_65_ffffff_1x400.png
Binary file not shown.
Binary file removed smoothness/images/ui-bg_glass_75_dadada_1x400.png
Binary file not shown.
Binary file removed smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
Binary file not shown.
Binary file removed smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
Binary file not shown.
Binary file not shown.
Binary file removed smoothness/images/ui-icons_454545_256x240.png
Binary file not shown.
Binary file removed smoothness/images/ui-icons_888888_256x240.png
Binary file not shown.
Binary file added theme/jsmvc/images/ui-bg_flat_100_899d09_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/jsmvc/images/ui-bg_flat_75_c3e2ef_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/jsmvc/images/ui-bg_flat_75_d2d988_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/jsmvc/images/ui-bg_flat_75_e6f1ba_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/jsmvc/images/ui-icons_404038_256x240.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3ed6e37

Please sign in to comment.