Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.
/ scenic Public archive

Commit

Permalink
IE support.
Browse files Browse the repository at this point in the history
Tested with MSIE 8.
  • Loading branch information
HyeonJe Jun committed Nov 18, 2012
1 parent 1b80b4b commit 2ef94e0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/js/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function Socket(channel) {

this.disconnect = function() {
window.chat_view.remove();
delete(window.chat_view);
window.chat_view = null;
this.io.emit('force_disconnect');
console.log('Scenic socket disconnected.');
};
Expand Down
14 changes: 8 additions & 6 deletions client/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ if(!console) var console = {};
if(!console.log) console.log = function(msg) { /* do nothing */ };

$(function() {
// fix firefox socket.io disconnected problem
window.addEventListener('keydown', function(e) {
if(e.keyCode == 27) {
e.preventDefault();
}
});
if($.browser.mozilla) {
// fix firefox socket.io disconnected problem
window.addEventListener('keydown', function(e) {
if(e.keyCode == 27) {
e.preventDefault();
}
});
}
});

String.prototype.endswith = function(suffix) {
Expand Down
10 changes: 10 additions & 0 deletions client/js/views/chat-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ var ChatView = Backbone.View.extend({

$('.chat-log', this.object).append(chatlog);

if($.browser.msie) {
// refresh chatlog for ie
$('.chat-log', this.object).hide().show();
}

// scroll to bottom
$('.scroll-box', this.object).scrollTop($('.chat-log', this.object).height());
$('.scroll-box', this.object).perfectScrollbar('update');
Expand All @@ -100,6 +105,11 @@ var ChatView = Backbone.View.extend({

$('.chat-log', this.object).append(ich.notice_template({msg: msg}));

if($.browser.msie) {
// refresh chatlog for ie
$('.chat-log', this.object).hide().show();
}

// scroll to bottom
$('.scroll-box', this.object).scrollTop($('.chat-log', this.object).height());
$('.scroll-box', this.object).perfectScrollbar('update');
Expand Down

0 comments on commit 2ef94e0

Please sign in to comment.