diff --git a/static/default/html/partials/search_item.html b/static/default/html/partials/search_item.html index fb34b8c7f..79824d35a 100644 --- a/static/default/html/partials/search_item.html +++ b/static/default/html/partials/search_item.html @@ -23,18 +23,18 @@ - {% if metadata.from.fn %}{{ metadata.from.fn|nice_name(28) }}{% else %}({{_("No Name")}}){% endif %} - {% if conversation_count > 1 %}{{conversation_count}}{% endif %} - {% if metadata.flags.replied %}{% endif %} + {% if metadata.from.fn %}{{ metadata.from.fn|nice_name(28) }}{% else %}({{_("No Name")}}){% endif %} + {% if conversation_count > 1 %}{{conversation_count}}{% endif %} + {% if metadata.flags.replied %}{% endif %} + - {% if has_label_tags(result.data.tags, metadata.tag_tids) %} {% for tid in metadata.tag_tids %} {% set tag = result.data.tags[tid] %} {% if tag.label and not tag.searched %} - + {{tag.name}} @@ -42,7 +42,7 @@ {% endfor %} {% endif %} - {% if metadata.subject %}{{ metadata.subject|nice_subject }}{% else %}({{_("No Subject")}}){% endif %} + {% if metadata.subject %}{{ metadata.subject|nice_subject }}{% else %}({{_("No Subject")}}){% endif %} {{metadata.timestamp|elapsed_datetime}} diff --git a/static/default/html/partials/tooltips.html b/static/default/html/partials/tooltips.html index db69f203c..a26b33f2d 100644 --- a/static/default/html/partials/tooltips.html +++ b/static/default/html/partials/tooltips.html @@ -1,8 +1,7 @@ \ No newline at end of file diff --git a/static/default/js/app/pile.js b/static/default/js/app/pile.js index b8efbf0fb..e9fffa49c 100644 --- a/static/default/js/app/pile.js +++ b/static/default/js/app/pile.js @@ -33,6 +33,7 @@ MailPile.prototype.pile_action_unselect = function(item) { .prop('checked', false); }; + /* Pile - Display */ MailPile.prototype.pile_display = function(current, change) { @@ -51,6 +52,7 @@ MailPile.prototype.pile_display = function(current, change) { } + /* Pile - Bulk Select / Unselect All */ $(document).on('click', '#pile-select-all-action', function(e) { @@ -73,17 +75,23 @@ $(document).on('click', '#pile-select-all-action', function(e) { /* Pile - Select & Unselect Items */ $(document).on('click', '#pile-results tr.result', function(e) { - if (e.target.href === undefined && $(this).data('state') !== 'selected') { + console.log() + if (e.target.href === undefined && + $(this).data('state') !== 'selected' && + $(e.target).hasClass('pile-message-tag-name') == false) { mailpile.pile_action_select($(this)); } }); $(document).on('click', '#pile-results tr.result-on', function(e) { - if (e.target.href === undefined && $(this).data('state') === 'selected') { + if (e.target.href === undefined && + $(this).data('state') === 'selected' && + $(e.target).hasClass('pile-message-tag-name') == false) { mailpile.pile_action_unselect($(this)); } }); + /* Pile - Show Unread */ $(document).on('click', '.button-sub-navigation', function() { @@ -270,9 +278,21 @@ MailPile.prototype.sidebar_tags_droppable_opts = { } }; +/* Make Pile items draggable to sidebar */ $('li.sidebar-tags-draggable').droppable(mailpile.sidebar_tags_droppable_opts); +/* Tag Tooltip - Actions */ +$(document).on('click', '.pile-tag-delete', function(e) { + e.preventDefault(); + var tid = $(this).data('tid'); + var mid = $(this).data('mid'); + mailpile.tag_add_delete([], tid, mid, function(result) { + $('#pile-message-tag-' + tid + '-' + mid).qtip('hide').remove(); + }); +}); + + $(document).ready(function() { // Render Display Size @@ -294,10 +314,9 @@ $(document).ready(function() { content: { title: false, text: function(event, api) { - var tag = _.findWhere(mailpile.instance.tags, { tid: $(this).data('tid').toString() }); - var template = $('#tooltip-pile-tag-details').html(); - var html = _.template(template, tag); - return html; + var tooltip_data = _.findWhere(mailpile.instance.tags, { tid: $(this).data('tid').toString() }); + tooltip_data['mid'] = $(this).data('mid'); + return _.template($('#tooltip-pile-tag-details').html(), tooltip_data); } }, style: { @@ -319,10 +338,12 @@ $(document).ready(function() { } }, show: { + event: 'click', delay: 150 }, hide: { - delay: 1000 + event: false, + inactive: 700 } }); diff --git a/static/default/less/app/pile.less b/static/default/less/app/pile.less index f99c6e208..55c2da53d 100644 --- a/static/default/less/app/pile.less +++ b/static/default/less/app/pile.less @@ -29,7 +29,7 @@ #pile-results tr a { font-size: 14px; font-weight: normal; color: inherit; } #pile-results tr.in_new a { font-weight: bold;} - #pile-results td span.pile-message-tag { font-weight: bold; margin-right: 5px; } + #pile-results td span.pile-message-tag { font-weight: bold; margin-right: 5px; cursor: pointer; } #pile-results td.draggable { width: 12px; cursor: move; } #pile-results td.draggable:hover { cursor: move; }