summaryrefslogtreecommitdiff
path: root/web-ui/app/js/tags/ui/tag_shortcut.js
diff options
context:
space:
mode:
authorAlexandre Pretto Nunes <anunes@thoughtworks.com>2015-02-13 17:49:46 -0200
committerAlexandre Pretto Nunes <anunes@thoughtworks.com>2015-02-19 16:41:24 -0200
commit63f74d2d9bcc85cff2fea92e80f49774bef5e6bf (patch)
tree1848295a91932db90afdbbc10bfd6b562059bf5f /web-ui/app/js/tags/ui/tag_shortcut.js
parent8e2143bce8c05d1e7ad6e9fbb4052b80ef49da9d (diff)
#239 Remove deprecated code of tag shortcuts
Diffstat (limited to 'web-ui/app/js/tags/ui/tag_shortcut.js')
-rw-r--r--web-ui/app/js/tags/ui/tag_shortcut.js85
1 files changed, 0 insertions, 85 deletions
diff --git a/web-ui/app/js/tags/ui/tag_shortcut.js b/web-ui/app/js/tags/ui/tag_shortcut.js
deleted file mode 100644
index b5b76825..00000000
--- a/web-ui/app/js/tags/ui/tag_shortcut.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2014 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/>.
- */
-'use strict';
-define(
- [
- 'flight/lib/component',
- 'views/templates',
- 'page/events',
- 'tags/ui/tag_base',
- 'flight/lib/utils'
- ],
-
- function (describeComponent, templates, events, tagBase, utils) {
-
- var TagShortcut = describeComponent(tagShortcut, tagBase);
-
- TagShortcut.appendedTo = function (parent, data) {
- var res = new this();
- res.renderAndAttach(parent, data);
- return res;
- };
-
- return TagShortcut;
-
- function tagShortcut() {
-
- this.renderTemplate = function (tag, currentTag) {
- var model = {
- tagName: tag.name,
- displayBadge: this.displayBadge(tag),
- badgeType: this.badgeType(tag),
- count: this.badgeType(tag) === 'total' ? tag.counts.total : (tag.counts.total - tag.counts.read),
- icon: iconFor[tag.name],
- selected: tag.name === currentTag ? 'selected' : ''
- };
- return templates.tags.shortcut(model);
- };
-
- this.renderAndAttach = function (parent, options) {
- parent.append(this.renderTemplate(options.tag, options.currentTag));
- this.initialize(parent.children().last(), options);
- };
-
- this.reRender = function () {
- this.$node.html(this.renderTemplate(this.attr.tag, this.attr.currentTag));
- };
-
- var iconFor = {
- 'inbox': 'inbox',
- 'sent': 'send',
- 'drafts': 'pencil',
- 'trash': 'trash-o',
- 'all': 'archive'
- };
-
- this.doTeardown = function () {
- if (!jQuery.contains(document, this.$node[0])) {
- this.teardown();
- }
- };
-
- this.after('initialize', function () {
- this.on('click', function () {
- this.attr.trigger.triggerSelect();
- });
- this.on(document, events.tags.shortcuts.teardown, this.doTeardown);
- });
-
- }
- }
-);