Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add onbackclick support for title bar to hook custom logic to the titlebar back button #771

Closed
wants to merge 3 commits into from

2 participants

@xqliu

This commit is created to add a custom onbackclick attribute for titlebar,

The logic is

  • If there's no onbackclick attribute defined for the titlebar, then bb.pushScreen() will be invoked, that's the same as former behavior.

  • If there's any onbackclick attribute defined for the titlebar, then the code defined in onbackclick will be invoked, like onactionclick.

    This request add another possibility to control the page flow, using cancel button in the titlebar.

@tneil
Owner

Would it be possible to split these two changes into separate pull requests. It would be easier to review them separately.

@xqliu xqliu Revert "Add feature to set Selected Tab without invoke defined onclic…
…k of the actionbar"

This reverts commit 1785f7bd062922816f8084b866c27468c24df914.
2c2eb2f
@xqliu

According to my test, there's a highlight issue regarding the selected tab push, so it was reverted back,

And only one commit exists in this request.

@tneil
Owner

One of the main things we want to do with the back button is ensure that it is always a back button. If we allow for custom onbackbutton events, I want to make sure that we call that custom code and then also call popScreen() to move back.

This would allow you to do custom code when back is clicked, but not change the fact that the screen will go back. If we add this I would also suggest adding the same event to the actionbar

@xqliu

Sounds reasonable, I will change it accordingly and then submit the request again.

Thanks for you review :)

@tneil tneil closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 28, 2013
  1. @xqliu
  2. @xqliu
Commits on Mar 29, 2013
  1. @xqliu

    Revert "Add feature to set Selected Tab without invoke defined onclic…

    xqliu authored
    …k of the actionbar"
    
    This reverts commit 1785f7bd062922816f8084b866c27468c24df914.
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 1 deletion.
  1. +15 −1 samples/bbui.js
View
16 samples/bbui.js
@@ -3347,7 +3347,21 @@ bb.titleBar = {
// Get our values
outerElement.maxValue = progress.hasAttribute('max') ? parseInt(progress.getAttribute('max')) : 0;
outerElement.value = progress.hasAttribute('value') ? parseInt(progress.getAttribute('value')) : 0;
- // Set our styling and create the inner divs
+ // Set our styling and create the inner divs
+ outerElement.className = 'bb-progress';
+ outerElement.outer = document.createElement('div');
+ outerElement.outer.setAttribute('class','outer bb-progress-outer-' + color + ' bb-progress-outer-idle-background-' + color);
+ outerElement.appendChild(outerElement.outer);
+ outerElement.fill = document.createElement('div');
+ if (bb.device.isBB10) {
+ outerElement.fill.normal = 'bb-progress-fill bb10Highlight';
+ } else {
+ outerElement.fill.normal = 'bb-progress-fill bbProgressHighlight';
+ }
+ outerElement.fill.setAttribute('class',outerElement.fill.normal);
+ outerElement.outer.appendChild(outerElement.fill);
+ outerElement.inner = document.createElement('div');
+ outerElement.inner.className = 'inner';
outerElement.outer.appendChild(outerElement.inner);
// Assign our function to set the value for the control
Something went wrong with that request. Please try again.