Fix Options.init when it's executed as an event callback.

This commit is contained in:
Nicolas Stepien 2012-03-06 01:34:03 +01:00
parent fcfafa6ae3
commit f38f8fa9e9
2 changed files with 6 additions and 8 deletions

View File

@ -1611,7 +1611,6 @@
bb.append(ui8a.buffer); bb.append(ui8a.buffer);
_this.url = url.createObjectURL(bb.getBlob('image/png')); _this.url = url.createObjectURL(bb.getBlob('image/png'));
_this.el.style.backgroundImage = "url(" + _this.url + ")"; _this.el.style.backgroundImage = "url(" + _this.url + ")";
console.log(_this.url);
return url.revokeObjectURL(fileUrl); return url.revokeObjectURL(fileUrl);
}); });
return img.src = fileUrl; return img.src = fileUrl;
@ -2155,12 +2154,12 @@
textContent: '4chan X', textContent: '4chan X',
href: 'javascript:;' href: 'javascript:;'
}); });
$.on(a, 'click', this.dialog); $.on(a, 'click', Options.dialog);
$.replace(home.firstElementChild, a); $.replace(home.firstElementChild, a);
} }
if (!$.get('firstrun')) { if (!$.get('firstrun')) {
$.set('firstrun', true); $.set('firstrun', true);
return this.dialog(); return Options.dialog();
} }
}, },
dialog: function() { dialog: function() {
@ -4244,7 +4243,7 @@ textarea.field {\
.warning {\ .warning {\
color: red;\ color: red;\
}\ }\
td.replyhider {\ .replyhider {\
vertical-align: top;\ vertical-align: top;\
}\ }\
\ \

View File

@ -1319,7 +1319,6 @@ qr =
@url = url.createObjectURL bb.getBlob 'image/png' @url = url.createObjectURL bb.getBlob 'image/png'
@el.style.backgroundImage = "url(#{@url})" @el.style.backgroundImage = "url(#{@url})"
console.log @url
url.revokeObjectURL fileUrl url.revokeObjectURL fileUrl
img.src = fileUrl img.src = fileUrl
@ -1770,11 +1769,11 @@ Options =
a = $.el 'a', a = $.el 'a',
textContent: '4chan X' textContent: '4chan X'
href: 'javascript:;' href: 'javascript:;'
$.on a, 'click', @dialog $.on a, 'click', Options.dialog
$.replace home.firstElementChild, a $.replace home.firstElementChild, a
unless $.get 'firstrun' unless $.get 'firstrun'
$.set 'firstrun', true $.set 'firstrun', true
@dialog() Options.dialog()
dialog: -> dialog: ->
dialog = $.el 'div' dialog = $.el 'div'
@ -3541,7 +3540,7 @@ textarea.field {
.warning { .warning {
color: red; color: red;
} }
td.replyhider { .replyhider {
vertical-align: top; vertical-align: top;
} }