Fix whitespace in popup.js
Our official standard is 4 space indentation.
This commit is contained in:
parent
778fa6b627
commit
ae98b8680f
1 changed files with 43 additions and 43 deletions
86
js/popup.js
86
js/popup.js
|
@ -1,4 +1,4 @@
|
||||||
/* vim: ts=4:sw=4:noexpandtab:
|
/* vim: ts=4:sw=4:expandtab:
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -15,57 +15,57 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Whisper.Layout = new (Backbone.View.extend({
|
Whisper.Layout = new (Backbone.View.extend({
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.gutter = $('#gutter');
|
this.gutter = $('#gutter');
|
||||||
this.contacts = $('#contacts');
|
this.contacts = $('#contacts');
|
||||||
this.resize();
|
this.resize();
|
||||||
|
|
||||||
new Whisper.ConversationListView({el: $('#contacts')});
|
new Whisper.ConversationListView({el: $('#contacts')});
|
||||||
window.addEventListener('resize', this.resize.bind(this));
|
window.addEventListener('resize', this.resize.bind(this));
|
||||||
Whisper.Threads.fetch({reset: true});
|
Whisper.Threads.fetch({reset: true});
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
'click #new-message': 'new_message',
|
'click #new-message': 'new_message',
|
||||||
'click #new-group': 'new_group'
|
'click #new-group': 'new_group'
|
||||||
},
|
},
|
||||||
|
|
||||||
new_message: function(e) {
|
new_message: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('.conversation').hide().trigger('close'); // detach any existing conversation views
|
$('.conversation').hide().trigger('close'); // detach any existing conversation views
|
||||||
this.view = new Whisper.NewConversationView();
|
this.view = new Whisper.NewConversationView();
|
||||||
//todo: less new
|
//todo: less new
|
||||||
},
|
},
|
||||||
|
|
||||||
new_group: function(e) {
|
new_group: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('.conversation').trigger('close'); // detach any existing conversation views
|
$('.conversation').trigger('close'); // detach any existing conversation views
|
||||||
new Whisper.NewGroupView({ el: $('.conversation') });
|
new Whisper.NewGroupView({ el: $('.conversation') });
|
||||||
},
|
},
|
||||||
resize: function (e) {
|
resize: function (e) {
|
||||||
var windowheight = window.innerHeight;
|
var windowheight = window.innerHeight;
|
||||||
var form = $('.send-message-area').outerHeight();
|
var form = $('.send-message-area').outerHeight();
|
||||||
var gutter_offset = this.gutter.offset().top;
|
var gutter_offset = this.gutter.offset().top;
|
||||||
var contacts_offset = this.contacts.offset().top;
|
var contacts_offset = this.contacts.offset().top;
|
||||||
if (window.innerWidth < 480) {
|
if (window.innerWidth < 480) {
|
||||||
this.gutter.css('height', windowheight - gutter_offset - form);
|
this.gutter.css('height', windowheight - gutter_offset - form);
|
||||||
this.contacts.css('height', windowheight - contacts_offset - form);
|
this.contacts.css('height', windowheight - contacts_offset - form);
|
||||||
} else {
|
} else {
|
||||||
this.gutter.css('height', windowheight - gutter_offset);
|
this.gutter.css('height', windowheight - gutter_offset);
|
||||||
this.contacts.css('height', windowheight - contacts_offset);
|
this.contacts.css('height', windowheight - contacts_offset);
|
||||||
}
|
}
|
||||||
$('.discussion').css('height', windowheight - gutter_offset - form);
|
$('.discussion').css('height', windowheight - gutter_offset - form);
|
||||||
},
|
},
|
||||||
setContent: function(content) {
|
setContent: function(content) {
|
||||||
$(content).insertAfter(this.gutter);
|
$(content).insertAfter(this.gutter);
|
||||||
this.resize();
|
this.resize();
|
||||||
}
|
}
|
||||||
}))({el: document});
|
}))({el: document});
|
||||||
|
|
||||||
textsecure.registerOnLoadFunction(function() {
|
textsecure.registerOnLoadFunction(function() {
|
||||||
if (textsecure.storage.getUnencrypted("number_id") === undefined) {
|
if (textsecure.storage.getUnencrypted("number_id") === undefined) {
|
||||||
extension.navigator.tabs.create("options.html");
|
extension.navigator.tabs.create("options.html");
|
||||||
} else {
|
} else {
|
||||||
textsecure.storage.putUnencrypted("unreadCount", 0);
|
textsecure.storage.putUnencrypted("unreadCount", 0);
|
||||||
extension.navigator.setBadgeText("");
|
extension.navigator.setBadgeText("");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue