Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: qooxdoo/qooxdoo
...
head fork: qooxdoo/qooxdoo
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 30, 2012
Christopher Zuendorf [BUG #6392] Add tablet/mobile/desktop env variable
Put defer on right position.
0c0837f
Christopher Zuendorf [BUG #6392] Add tablet/mobile/desktop env variable
Fix tests.
09dd56f
Christopher Zuendorf [BUG #6465] Tablet Support: Layout of MasterContainer fix a893b6f
View
9 application/mobileshowcase/source/class/mobileshowcase/Application.js
@@ -104,17 +104,10 @@ qx.Class.define("mobileshowcase.Application",
themeSwitcher
]);
- if(isTablet||isDesktop){
- overview.show();
- basic.show();
- } else {
- overview.show();
- }
-
// Initialize the navigation
var nm = qx.ui.mobile.navigation.Manager.getInstance();
- if (isTablet) {
+ if (isTablet||isDesktop) {
nm.onGet("/.*", function(data) {
overview.show();
},this);
View
16 framework/source/class/qx/bom/client/Device.js
@@ -73,7 +73,7 @@ qx.Bootstrap.define("qx.bom.client.Device",
* @return {String} The device type name of determined device.
*/
getType : function() {
- return this.detectDeviceType(navigator.userAgent);
+ return qx.bom.client.Device.detectDeviceType(navigator.userAgent);
},
@@ -84,9 +84,9 @@ qx.Bootstrap.define("qx.bom.client.Device",
* @return {String} The device type name of determined device: "mobile","desktop","tablet"
*/
detectDeviceType : function(userAgentString) {
- if(this.detectTabletDevice(userAgentString)){
+ if(qx.bom.client.Device.detectTabletDevice(userAgentString)){
return "tablet";
- } else if (this.detectMobileDevice(userAgentString)){
+ } else if (qx.bom.client.Device.detectMobileDevice(userAgentString)){
return "mobile";
}
@@ -111,13 +111,13 @@ qx.Bootstrap.define("qx.bom.client.Device",
*/
detectTabletDevice : function(userAgentString){
return !(/Fennec|HTC.Magic|Nexus|android.+mobile/i.test(userAgentString)) && (/Android|ipad|tablet|playbook|silk|kindle|psp/i.test(userAgentString));
- },
+ }
-
- defer : function(statics) {
+ },
+
+
+ defer : function(statics) {
qx.core.Environment.add("device.name", statics.getName);
qx.core.Environment.add("device.type", statics.getType);
- }
}
-
});
View
7 framework/source/class/qx/ui/mobile/dialog/Popup.js
@@ -162,7 +162,6 @@ qx.Class.define("qx.ui.mobile.dialog.Popup",
if(this.__anchor)
{
- // TODO: remove this hack, find another way to compute the anchorPointer location
var pos = qx.bom.element.Location.getPosition(this.__anchor.getContainerElement());
var dimension = qx.bom.element.Dimension.getSize(this.getContainerElement());
var anchorDimension = qx.bom.element.Dimension.getSize(this.__anchor.getContainerElement());
@@ -195,8 +194,6 @@ qx.Class.define("qx.ui.mobile.dialog.Popup",
this.placeTo(pos.left, pos.top);
}
else {
- //this.__anchorPointer._setStyle('marginLeft',(anchorDimension.width/2)+'px');
-
var newDimension = qx.bom.element.Dimension.getSize(this.getContainerElement());
this.placeTo(pos.left, pos.top + anchorDimension.height);
this.addCssClass('popupAnchorPointerTop');
@@ -439,8 +436,8 @@ qx.Class.define("qx.ui.mobile.dialog.Popup",
getTitleWidget : function() {
return this.__titleWidget;
},
-
-
+
+
/**
* This method removes the widget shown in the popup.
*/
View
92 framework/source/class/qx/ui/mobile/page/Manager.js
@@ -78,7 +78,7 @@ qx.Class.define("qx.ui.mobile.page.Manager",
this.__portraitMasterContainer = this._createPortraitMasterContainer(this.__masterButton);
this.__masterDetailContainer.setPortraitMasterContainer(this.__portraitMasterContainer);
-
+
root.add(this.__masterDetailContainer, {flex:1});
this.__masterDetailContainer.getMaster().add(this.__masterContainer, {flex:1});
@@ -104,6 +104,16 @@ qx.Class.define("qx.ui.mobile.page.Manager",
init : "Master",
check : "String",
apply : "_applyMasterTitle"
+ },
+
+
+ /**
+ * The PortraitMasterContainer will have the height of displayed
+ * MasterPage content + MasterPage Title + portraitMasterScrollOffset
+ */
+ portraitMasterScrollOffset : {
+ init : 5,
+ check : "Integer"
}
},
@@ -122,6 +132,7 @@ qx.Class.define("qx.ui.mobile.page.Manager",
__masterDetailContainer : null,
__portraitMasterContainer : null,
__masterButton : null,
+ __masterPages : null,
/**
@@ -130,15 +141,25 @@ qx.Class.define("qx.ui.mobile.page.Manager",
*/
addMaster : function(pages) {
if (this.__isTablet) {
- if(pages){
- this._add(pages, this.__masterContainer);
-
- // First page's title is default of MasterButton caption and popup title.
- var masterPage = pages;
- if(qx.lang.Type.isArray(pages)){
- masterPage = pages[0];
+ if(pages) {
+
+ if(!qx.lang.Type.isArray(pages)) {
+ pages = [pages];
+ }
+
+ for(var i=0; i<pages.length; i++) {
+ var masterPage = pages[i];
+ qx.event.Registration.addListener(masterPage, "appear", this.__onMasterPageAppear, this);
+ qx.event.Registration.addListener(masterPage, "start", this.__onMasterPageStart, this);
}
- this.setMasterTitle(masterPage.getTitle());
+
+ if(this.__masterPages) {
+ this.__masterPages.concat(pages);
+ } else {
+ this.__masterPages = pages;
+ }
+
+ this._add(pages, this.__masterContainer);
}
} else {
this.addDetail(pages);
@@ -147,6 +168,34 @@ qx.Class.define("qx.ui.mobile.page.Manager",
/**
+ * Called when a masterPage reaches lifecycle state "start". Then property masterTitle will be update with masterPage's title.
+ * @param evt {qx.event.type.Event} source event.
+ */
+ __onMasterPageStart : function(evt) {
+ var masterPage = evt.getTarget();
+ var masterPageTitle = masterPage.getTitle();
+ this.setMasterTitle(masterPageTitle);
+ },
+
+
+ /**
+ * Sizes the height of the portraitMasterContainer to the content of the masterPage.
+ * @param evt {qx.event.type.Event} source event.
+ */
+ __onMasterPageAppear: function(evt) {
+ var masterPage = evt.getTarget();
+ var masterPageContentHeight = qx.bom.element.Dimension.getHeight(masterPage.getContent().getContentElement());
+ var portraitMasterTitleHeight = 0;
+ if(this.__portraitMasterContainer.getTitleWidget()){
+ portraitMasterTitleHeight = qx.bom.element.Dimension.getHeight(this.__portraitMasterContainer.getTitleWidget().getContentElement());
+ }
+ var maxHeight = masterPageContentHeight+portraitMasterTitleHeight+this.getPortraitMasterScrollOffset();
+
+ qx.bom.element.Style.set(this.__portraitMasterContainer.getContentElement(), "max-height", maxHeight+"px");
+ },
+
+
+ /**
* Adds an array of NavigationPage to the detailContainer.
* @param pages {qx.ui.mobile.page.NavigationPage[]|qx.ui.mobile.page.NavigationPage} Array of NavigationPages or single NavigationPage.
*/
@@ -271,8 +320,21 @@ qx.Class.define("qx.ui.mobile.page.Manager",
this.__portraitMasterContainer.hide();
} else {
this.__portraitMasterContainer.show();
+ qx.event.Registration.addListener(this.__detailContainer, "tap", this._onDetailContainerTap, this);
}
},
+
+
+ /**
+ * Reacts on tap at __detailContainer.
+ * Hides the __portraitMasterContainer and removes the listener.
+ */
+ _onDetailContainerTap : function(){
+ this.__portraitMasterContainer.hide();
+
+ // Listener should only be installed, as long as portraitMasterContainer is shown.
+ qx.event.Registration.removeListener(this.__detailContainer, "tap", this._onDetailContainerTap, this);
+ },
/**
@@ -319,7 +381,19 @@ qx.Class.define("qx.ui.mobile.page.Manager",
destruct : function()
{
+ if(this.__masterPages) {
+ for(var i=0; i<this.__masterPages.length;i++) {
+ var masterPage = this.__masterPages[i];
+
+ qx.event.Registration.removeListener(masterPage, "appear", this.__onMasterPageAppear, this);
+ qx.event.Registration.removeListener(masterPage, "start", this.__onMasterPageStart, this);
+ }
+ }
+
+ this.__masterPages = null;
+
this._disposeObjects("__detailContainer", "__masterContainer", "__masterDetailContainer",
"__portraitMasterContainer", "__masterButton");
+
}
});
View
2  framework/source/resource/qx/mobile/css/ios.css
1 addition, 1 deletion not shown
View
4 framework/source/resource/qx/mobile/less/basic/_toggleButton.less
@@ -36,7 +36,7 @@ div.checked .toggleButtonSwitch:before {
content: ' 'attr(data-label-checked);
width:52px;
left:-50px;
- line-height:25.9px;
+ line-height:26px;
height:26px;
text-align:center;
overflow:hidden;
@@ -46,7 +46,7 @@ div.checked .toggleButtonSwitch:before {
position:absolute;
content: ' 'attr(data-label-unchecked);
left: 25px;
- line-height:25.9px;
+ line-height:26px;
height:26px;
width:52px;
text-align:center;

No commit comments for this range

Something went wrong with that request. Please try again.