Skip to content

Commit

Permalink
Moved Message thread JS to init style
Browse files Browse the repository at this point in the history
  • Loading branch information
bnvk committed Oct 22, 2014
1 parent 91f3c51 commit 30cef26
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions static/default/html/jsapi/index-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
{% include("jsapi/tags/content.js") %}

/* JS - Message */
{% include("jsapi/message/init.js") %}
{% include("jsapi/message/thread.js") %}
{% include("jsapi/message/message.js") %}
{% include("jsapi/message/tooltips.js") %}
Expand Down
11 changes: 11 additions & 0 deletions static/default/html/jsapi/message/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Message - Create new instance of composer */

Mailpile.Message = {};


Mailpile.Message.init = function() {

Mailpile.thread_scroll_to_message();
Mailpile.thread_initialize_tooltips();

};
15 changes: 0 additions & 15 deletions static/default/html/jsapi/message/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,3 @@ $('div.thread-draggable').draggable({
},
stop: function(event, ui) {}
});


/* Thread Tooltips */
$(document).ready(function() {

// Thread Scroll to Message
if (location.href.split("thread/=")[1]) {

// Scroll to Message
Mailpile.thread_scroll_to_message();

// Show Tooltips
Mailpile.thread_initialize_tooltips();
}
});
5 changes: 5 additions & 0 deletions static/default/html/message/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
{% endfor %}
</ul>
</div>
<script>
$(document).ready(function() {
Mailpile.Message.init();
});
</script>
{% else %}{# No Result, Show Error #}
{% set error_title = "message_missing" %}
{% include("partials/errors_content.html") %}
Expand Down

0 comments on commit 30cef26

Please sign in to comment.