Skip to content

Commit

Permalink
Made some JS .init() for Contags and Tags
Browse files Browse the repository at this point in the history
  • Loading branch information
bnvk committed Oct 24, 2014
1 parent 14e8e23 commit 10ab01f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 14 deletions.
5 changes: 5 additions & 0 deletions static/default/html/contacts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,10 @@
<h5>{% if result.total > 1 %}{{result.start}} - {{result.end}} {{_("of")}} {{result.total}} {{_("Contacts")}} {% elif result.total == 1 %} {{_("1 Conversation")}} {% else %} {{_("No results found")}} {% endif %}</h5>
</div>

<script>
$(document).ready(function() {
Mailpile.Contacts.init();
});
</script>
{% endblock %}

14 changes: 14 additions & 0 deletions static/default/html/jsapi/contacts/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* Contacts */

Mailpile.Contacts = {};
Mailpile.Contacts.UI = {};


Mailpile.Contacts.init = function() {


// Search Bar
$('#search-query').val('contacts: ');


};
5 changes: 3 additions & 2 deletions static/default/html/jsapi/index-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
{% include("jsapi/compose/body.js") %}

/* JS - Contacts */
{% include("jsapi/contacts/init.js") %}
{% include("jsapi/contacts/display_modes.js") %}
{% include("jsapi/contacts/content.js") %}

Expand All @@ -36,6 +37,7 @@
{% include("jsapi/settings/content.js") %}

/* JS - Tags */
{% include("jsapi/tags/init.js") %}
{% include("jsapi/tags/content.js") %}

/* JS - Message */
Expand All @@ -45,11 +47,10 @@
{% include("jsapi/message/tooltips.js") %}
{% include("jsapi/message/ui.js") %}

/* JS UI Files */
/* JS - UI */
{% include("jsapi/ui/init.js") %}
{% include("jsapi/ui/content.js") %}
{% include("jsapi/ui/global.js") %}
{% include("jsapi/ui/topbar.js") %}
{% include("jsapi/ui/sidebar.js") %}
{% include("jsapi/ui/tooltips.js") %}

14 changes: 14 additions & 0 deletions static/default/html/jsapi/tags/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* Tags */

Mailpile.Tags = {};
Mailpile.Tags.UI = {};


Mailpile.Tags.init = function() {


// Search Bar
$('#search-query').val('tags: ');


};
12 changes: 0 additions & 12 deletions static/default/html/jsapi/ui/topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,3 @@ $(document).on('click', '#button-compose', function(e) {
Mailpile.activities.compose();
});


/* Activities - DOM */
$(document).ready(function() {
// Command Specific Mods
if (Mailpile.instance.state.command_url === '/contacts/') {
$('#search-query').val('contacts: ');
}
else if (Mailpile.instance.state.command_url === '/tags/') {
$('#search-query').val('tags: ');
}

});
5 changes: 5 additions & 0 deletions static/default/html/tags/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ <h4>{{_("Archived")}}</h4>
</div>
{% endif %}
</div>
<script>
$(document).ready(function() {
Mailpile.Tags.init();
});
</script>
{% endblock %}

0 comments on commit 10ab01f

Please sign in to comment.