Close the Header's menu when opening the QR.
Handle errors when opening the QR dialog.
This commit is contained in:
parent
566b468327
commit
0f0d410209
@ -1832,10 +1832,13 @@
|
|||||||
Main.css += "#postForm, .postingMode {\n display: none;\n}";
|
Main.css += "#postForm, .postingMode {\n display: none;\n}";
|
||||||
}
|
}
|
||||||
link = $.el('a', {
|
link = $.el('a', {
|
||||||
textContent: 'Open the QR',
|
textContent: 'Quick Reply',
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
});
|
});
|
||||||
$.on(link, 'click', QR.open);
|
$.on(link, 'click', function() {
|
||||||
|
Header.menu.close();
|
||||||
|
return QR.open();
|
||||||
|
});
|
||||||
$.event('AddMenuEntry', {
|
$.event('AddMenuEntry', {
|
||||||
type: 'header',
|
type: 'header',
|
||||||
el: link
|
el: link
|
||||||
@ -1848,7 +1851,7 @@
|
|||||||
},
|
},
|
||||||
readyInit: function() {
|
readyInit: function() {
|
||||||
if (Conf['Persistent QR']) {
|
if (Conf['Persistent QR']) {
|
||||||
QR.dialog();
|
QR.open();
|
||||||
if (Conf['Auto Hide QR']) {
|
if (Conf['Auto Hide QR']) {
|
||||||
QR.hide();
|
QR.hide();
|
||||||
}
|
}
|
||||||
@ -1865,7 +1868,14 @@
|
|||||||
QR.el.hidden = false;
|
QR.el.hidden = false;
|
||||||
return QR.unhide();
|
return QR.unhide();
|
||||||
} else {
|
} else {
|
||||||
return QR.dialog();
|
try {
|
||||||
|
return QR.dialog();
|
||||||
|
} catch (err) {
|
||||||
|
return Main.handleErrors({
|
||||||
|
message: 'Quick Reply dialog creation crashed.',
|
||||||
|
error: err
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
|
|||||||
@ -3,7 +3,9 @@ alpha
|
|||||||
Major rewrite of 4chan X.
|
Major rewrite of 4chan X.
|
||||||
New feature, the Header:
|
New feature, the Header:
|
||||||
Access the list of boards directly from the Header.
|
Access the list of boards directly from the Header.
|
||||||
Access to settings and extra features easily from the Header's menu.
|
From the Header's menu, access to:
|
||||||
|
Settings
|
||||||
|
Quick Reply
|
||||||
Can be auto-hidden.
|
Can be auto-hidden.
|
||||||
Added touch and multi-touch support for dragging windows.
|
Added touch and multi-touch support for dragging windows.
|
||||||
The Thread Updater will pause when offline, and resume when online.
|
The Thread Updater will pause when offline, and resume when online.
|
||||||
|
|||||||
@ -772,9 +772,11 @@ QR =
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
link = $.el 'a',
|
link = $.el 'a',
|
||||||
textContent: 'Open the QR'
|
textContent: 'Quick Reply'
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
$.on link, 'click', QR.open
|
$.on link, 'click', ->
|
||||||
|
Header.menu.close()
|
||||||
|
QR.open()
|
||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'header'
|
type: 'header'
|
||||||
el: link
|
el: link
|
||||||
@ -787,7 +789,7 @@ QR =
|
|||||||
|
|
||||||
readyInit: ->
|
readyInit: ->
|
||||||
if Conf['Persistent QR']
|
if Conf['Persistent QR']
|
||||||
QR.dialog()
|
QR.open()
|
||||||
QR.hide() if Conf['Auto Hide QR']
|
QR.hide() if Conf['Auto Hide QR']
|
||||||
$.on d, 'dragover', QR.dragOver
|
$.on d, 'dragover', QR.dragOver
|
||||||
$.on d, 'drop', QR.dropFile
|
$.on d, 'drop', QR.dropFile
|
||||||
@ -801,7 +803,12 @@ QR =
|
|||||||
QR.el.hidden = false
|
QR.el.hidden = false
|
||||||
QR.unhide()
|
QR.unhide()
|
||||||
else
|
else
|
||||||
QR.dialog()
|
try
|
||||||
|
QR.dialog()
|
||||||
|
catch err
|
||||||
|
Main.handleErrors
|
||||||
|
message: 'Quick Reply dialog creation crashed.'
|
||||||
|
error: err
|
||||||
close: ->
|
close: ->
|
||||||
QR.el.hidden = true
|
QR.el.hidden = true
|
||||||
QR.abort()
|
QR.abort()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user