Skip to content

Comparing changes

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

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 7 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 38 additions and 4 deletions.
  1. +25 −2 app/controller/Main.js
  2. +13 −2 app/view/Action.js
View
27 app/controller/Main.js
@@ -2,7 +2,30 @@ Ext.define('Sencha.controller.Main', {
extend: 'Ext.app.Controller',
config: {
- refs: {},
- control: {}
+ refs: {
+ homeTabButton: 'tabbar button[title=home]',
+ clearButton: 'button[action=clearHomeBadge]',
+ starButton: 'button[action=pingHomeBadge]'
+ },
+ control: {
+ clearButton: {
+ tap: 'clearHomeBadge'
+ },
+ starButton: {
+ tap: 'incrementHomeBadge'
+ },
+ }
+ },
+
+ incrementHomeBadge: function() {
+ var hometab = this.getHomeTabButton(),
+ badgenumber = parseInt(hometab.getBadgeText()),
+ nextnumber = isNaN(badgenumber) ? 1 : badgenumber+1;
+
+ hometab.setBadgeText(nextnumber);
+ },
+
+ clearHomeBadge: function() {
+ this.getHomeTabButton().setBadgeText("");
}
});
View
15 app/view/Action.js
@@ -9,8 +9,19 @@ Ext.define('Sencha.view.Action', {
styleHtmlContent: true,
items: [{
docked: 'top',
- xtype: 'toolbar',
- title: 'Buttons'
+ xtype: 'titlebar',
+ title: 'Titlebars accomodate buttons and titles',
+ items: [
+ {
+ text: 'ping',
+ align: 'right',
+ action: 'pingHomeBadge'
+ },{
+ text: 'clear',
+ align: 'left',
+ action: 'clearHomeBadge'
+ }
+ ]
}]
}
});

No commit comments for this range

Something went wrong with that request. Please try again.