Popups can specify content in three ways:
@@ -72,7 +72,7 @@ type : 'UI Module'
diff --git a/build/minified/modules/sidebar.js b/build/minified/modules/sidebar.js index 35528e6d0..9873aff86 100644 --- a/build/minified/modules/sidebar.js +++ b/build/minified/modules/sidebar.js @@ -135,20 +135,38 @@ $.fn.sidebar = function(parameters) { add: { bodyCSS: function() { var - style = '', - direction = module.get.direction(), - moduleSize = (module.is.vertical()) + style = '', + direction = module.get.direction(), + distance = (module.is.vertical()) ? $module.outerHeight() : $module.outerWidth() ; if(direction !== className.bottom) { style = '' + '' ; + if(settings.useTransform) { + style += '' + + 'body.pushed {' + + module.get.transform(direction, distance) + + '}' + + '' + ; + } + else { + style += '' + + 'body.pushed {' + + ' margin-' + direction + ': ' + distance + 'px !important;' + + '}' + + '' + ; + } } $head.append(style); module.refresh(); @@ -202,6 +220,49 @@ $.fn.sidebar = function(parameters) { return className.left; } }, + transform: function(direction, distance) { + if(direction && distance) { + if(direction == className.left) { + return '' + + module.get.transformProperty() + ': translate3d(' + distance + 'px, 0px, 0px);' + + 'margin-right: ' + distance + 'px !important;' + ; + } + if(direction == className.right) { + return '' + + module.get.transformProperty() + ': translate3d(-' + distance + 'px, 0px, 0px);' + + 'margin-left: ' + distance + 'px !important;' + ; + } + if(direction == className.top) { + return '' + + module.get.transformProperty() + ': translate3d(0px, ' + distance + 'px, 0px);' + ; + } + if(direction == className.bottom) { + return '' + + module.get.transformProperty() + ': translate3d(0px, -' + distance + 'px, 0px);' + ; + } + } + }, + transformProperty: function() { + var + element = document.createElement('element'), + properties = { + 'transform' :'transform', + 'msTransform' :'-ms-transform', + 'MozTransform' :'-moz-transform', + 'WebkitTransform' :'-webkit-transform' + }, + property + ; + for(property in properties){ + if( element.style[property] !== undefined ){ + return properties[property]; + } + } + }, transitionEvent: function() { var element = document.createElement('element'), @@ -413,21 +474,23 @@ $.fn.sidebar = function(parameters) { $.fn.sidebar.settings = { - moduleName : 'Sidebar', - namespace : 'sidebar', + moduleName : 'Sidebar', + namespace : 'sidebar', + + useTransform : true, - verbose : true, - debug : true, - performance : true, + verbose : true, + debug : true, + performance : true, - overlay : false, + overlay : false, - side : 'left', - duration : 500, + side : 'left', + duration : 500, - onChange : function(){}, - onShow : function(){}, - onHide : function(){}, + onChange : function(){}, + onShow : function(){}, + onHide : function(){}, className: { active : 'active', diff --git a/build/packaged/modules/sidebar.js b/build/packaged/modules/sidebar.js index 35528e6d0..9873aff86 100644 --- a/build/packaged/modules/sidebar.js +++ b/build/packaged/modules/sidebar.js @@ -135,20 +135,38 @@ $.fn.sidebar = function(parameters) { add: { bodyCSS: function() { var - style = '', - direction = module.get.direction(), - moduleSize = (module.is.vertical()) + style = '', + direction = module.get.direction(), + distance = (module.is.vertical()) ? $module.outerHeight() : $module.outerWidth() ; if(direction !== className.bottom) { style = '' + '' ; + if(settings.useTransform) { + style += '' + + 'body.pushed {' + + module.get.transform(direction, distance) + + '}' + + '' + ; + } + else { + style += '' + + 'body.pushed {' + + ' margin-' + direction + ': ' + distance + 'px !important;' + + '}' + + '' + ; + } } $head.append(style); module.refresh(); @@ -202,6 +220,49 @@ $.fn.sidebar = function(parameters) { return className.left; } }, + transform: function(direction, distance) { + if(direction && distance) { + if(direction == className.left) { + return '' + + module.get.transformProperty() + ': translate3d(' + distance + 'px, 0px, 0px);' + + 'margin-right: ' + distance + 'px !important;' + ; + } + if(direction == className.right) { + return '' + + module.get.transformProperty() + ': translate3d(-' + distance + 'px, 0px, 0px);' + + 'margin-left: ' + distance + 'px !important;' + ; + } + if(direction == className.top) { + return '' + + module.get.transformProperty() + ': translate3d(0px, ' + distance + 'px, 0px);' + ; + } + if(direction == className.bottom) { + return '' + + module.get.transformProperty() + ': translate3d(0px, -' + distance + 'px, 0px);' + ; + } + } + }, + transformProperty: function() { + var + element = document.createElement('element'), + properties = { + 'transform' :'transform', + 'msTransform' :'-ms-transform', + 'MozTransform' :'-moz-transform', + 'WebkitTransform' :'-webkit-transform' + }, + property + ; + for(property in properties){ + if( element.style[property] !== undefined ){ + return properties[property]; + } + } + }, transitionEvent: function() { var element = document.createElement('element'), @@ -413,21 +474,23 @@ $.fn.sidebar = function(parameters) { $.fn.sidebar.settings = { - moduleName : 'Sidebar', - namespace : 'sidebar', + moduleName : 'Sidebar', + namespace : 'sidebar', + + useTransform : true, - verbose : true, - debug : true, - performance : true, + verbose : true, + debug : true, + performance : true, - overlay : false, + overlay : false, - side : 'left', - duration : 500, + side : 'left', + duration : 500, - onChange : function(){}, - onShow : function(){}, - onHide : function(){}, + onChange : function(){}, + onShow : function(){}, + onHide : function(){}, className: { active : 'active', diff --git a/build/uncompressed/modules/sidebar.css b/build/uncompressed/modules/sidebar.css index 78f9ee239..ba06cda00 100644 --- a/build/uncompressed/modules/sidebar.css +++ b/build/uncompressed/modules/sidebar.css @@ -8,11 +8,17 @@ Sidebar *******************************/ body { - -webkit-transition: padding 0.3s ease; - -moz-transition: padding 0.3s ease; - -o-transition: padding 0.3s ease; - -ms-transition: padding 0.3s ease; - transition: padding 0.3s ease; + -webkit-transition: margin 0.3s ease, -webkit-transform 0.3s ease; + -moz-transition: margin 0.3s ease, -moz-transform 0.3s ease; + -o-transition: margin 0.3s ease, + transform 0.3s ease + ; + -ms-transition: margin 0.3s ease, + transform 0.3s ease + ; + transition: margin 0.3s ease, + transform 0.3s ease + ; } .ui.sidebar { position: fixed; diff --git a/build/uncompressed/modules/sidebar.js b/build/uncompressed/modules/sidebar.js index 35528e6d0..9873aff86 100644 --- a/build/uncompressed/modules/sidebar.js +++ b/build/uncompressed/modules/sidebar.js @@ -135,20 +135,38 @@ $.fn.sidebar = function(parameters) { add: { bodyCSS: function() { var - style = '', - direction = module.get.direction(), - moduleSize = (module.is.vertical()) + style = '', + direction = module.get.direction(), + distance = (module.is.vertical()) ? $module.outerHeight() : $module.outerWidth() ; if(direction !== className.bottom) { style = '' + '' ; + if(settings.useTransform) { + style += '' + + 'body.pushed {' + + module.get.transform(direction, distance) + + '}' + + '' + ; + } + else { + style += '' + + 'body.pushed {' + + ' margin-' + direction + ': ' + distance + 'px !important;' + + '}' + + '' + ; + } } $head.append(style); module.refresh(); @@ -202,6 +220,49 @@ $.fn.sidebar = function(parameters) { return className.left; } }, + transform: function(direction, distance) { + if(direction && distance) { + if(direction == className.left) { + return '' + + module.get.transformProperty() + ': translate3d(' + distance + 'px, 0px, 0px);' + + 'margin-right: ' + distance + 'px !important;' + ; + } + if(direction == className.right) { + return '' + + module.get.transformProperty() + ': translate3d(-' + distance + 'px, 0px, 0px);' + + 'margin-left: ' + distance + 'px !important;' + ; + } + if(direction == className.top) { + return '' + + module.get.transformProperty() + ': translate3d(0px, ' + distance + 'px, 0px);' + ; + } + if(direction == className.bottom) { + return '' + + module.get.transformProperty() + ': translate3d(0px, -' + distance + 'px, 0px);' + ; + } + } + }, + transformProperty: function() { + var + element = document.createElement('element'), + properties = { + 'transform' :'transform', + 'msTransform' :'-ms-transform', + 'MozTransform' :'-moz-transform', + 'WebkitTransform' :'-webkit-transform' + }, + property + ; + for(property in properties){ + if( element.style[property] !== undefined ){ + return properties[property]; + } + } + }, transitionEvent: function() { var element = document.createElement('element'), @@ -413,21 +474,23 @@ $.fn.sidebar = function(parameters) { $.fn.sidebar.settings = { - moduleName : 'Sidebar', - namespace : 'sidebar', + moduleName : 'Sidebar', + namespace : 'sidebar', + + useTransform : true, - verbose : true, - debug : true, - performance : true, + verbose : true, + debug : true, + performance : true, - overlay : false, + overlay : false, - side : 'left', - duration : 500, + side : 'left', + duration : 500, - onChange : function(){}, - onShow : function(){}, - onHide : function(){}, + onChange : function(){}, + onShow : function(){}, + onHide : function(){}, className: { active : 'active', diff --git a/node/src/documents/modules/popup.html b/node/src/documents/modules/popup.html index dba529346..15f81eefc 100755 --- a/node/src/documents/modules/popup.html +++ b/node/src/documents/modules/popup.html @@ -29,7 +29,7 @@ type : 'UI Module'
A standard popup
- +A popup can be large or small
- - + +A popup can have its colors inverted
- +Frequently used metadata like, title, content, html, or arrowOffset or variation, can be included in html metadata
A popup can be positioned to any side of an element. If space is not available, it will automatically search for a similar alternative position to use.
- - - - - - - - + + + + + + + +A popup can be formatted with a title
- +A popup can be formatted with html
- +A popup can have different transitions. Any transition with both an in and out animation can be specified. The following are just a few examples.
- +