mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-14 08:52:37 +01:00
Move help result up if shows
This commit is contained in:
@@ -5,6 +5,11 @@ app.run(function() {
|
||||
|
||||
dispatcher.commands({
|
||||
'help': function() {
|
||||
var helpResult = document.querySelector('.result .help');
|
||||
if(helpResult != null) {
|
||||
moveHelpResultUp(helpResult);
|
||||
return;
|
||||
}
|
||||
return new app.models.HelpResult();
|
||||
},
|
||||
'clear': function() {
|
||||
@@ -23,4 +28,16 @@ app.run(function() {
|
||||
return app.get('expression').parse(input);
|
||||
}
|
||||
});
|
||||
|
||||
function moveHelpResultUp(helpResult) {
|
||||
var container = helpResult.parentNode.parentNode;
|
||||
if(container.parentNode.firstChild != container) {
|
||||
|
||||
var out = container.parentNode;
|
||||
out.removeChild(container);
|
||||
out.insertBefore(container, out.firstChild);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user