diff options
author | Giovane <giovaneliberato@gmail.com> | 2015-12-01 23:04:34 -0200 |
---|---|---|
committer | Giovane <giovaneliberato@gmail.com> | 2015-12-29 15:13:53 -0200 |
commit | 14f0e57ccbda82206cd8149018b306c6f17032d9 (patch) | |
tree | 345770216b5e5991a5a573a809e8d7cc2f31653b /web-ui/app/js/page | |
parent | 8614202031525b87a55b16517a12f61c05b8b33a (diff) |
Shows unread count on title bar
- This commit creates the unread_count_title
component
Diffstat (limited to 'web-ui/app/js/page')
-rw-r--r-- | web-ui/app/js/page/default.js | 6 | ||||
-rw-r--r-- | web-ui/app/js/page/unread_count_title.js | 40 |
2 files changed, 45 insertions, 1 deletions
diff --git a/web-ui/app/js/page/default.js b/web-ui/app/js/page/default.js index 3005c027..1ca10b50 100644 --- a/web-ui/app/js/page/default.js +++ b/web-ui/app/js/page/default.js @@ -50,6 +50,7 @@ define( 'mail_view/ui/feedback_box', 'mail_view/data/feedback_sender', 'page/version', + 'page/unread_count_title', ], function ( @@ -86,7 +87,8 @@ define( feedback, feedbackBox, feedbackSender, - version) { + version, + unreadCountTitle) { 'use strict'; function initialize(path) { @@ -125,6 +127,8 @@ define( feedback.attachTo('#feedback'); feedbackSender.attachTo(document); + + unreadCountTitle.attachTo('#unread-count-title'); } return initialize; diff --git a/web-ui/app/js/page/unread_count_title.js b/web-ui/app/js/page/unread_count_title.js new file mode 100644 index 00000000..f60f5668 --- /dev/null +++ b/web-ui/app/js/page/unread_count_title.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2015 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see <http://www.gnu.org/licenses/>. + */ + + +define( + [ + 'flight/lib/component', + 'views/templates', + 'page/events', + ], + + function (defineComponent, templates, events) { + 'use strict'; + + return defineComponent(function () { + this.render = function () { + var unreadCountTitleHTML = templates.page.unreadCountTitle(); + this.$node.html(unreadCountTitleHTML); + }; + + this.after('initialize', function () { + this.render(); + }); + + }); +}); |