mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-15 01:12:47 +01:00
Move help result up if shows
This commit is contained in:
@@ -5,6 +5,11 @@ app.run(function() {
|
|||||||
|
|
||||||
dispatcher.commands({
|
dispatcher.commands({
|
||||||
'help': function() {
|
'help': function() {
|
||||||
|
var helpResult = document.querySelector('.result .help');
|
||||||
|
if(helpResult != null) {
|
||||||
|
moveHelpResultUp(helpResult);
|
||||||
|
return;
|
||||||
|
}
|
||||||
return new app.models.HelpResult();
|
return new app.models.HelpResult();
|
||||||
},
|
},
|
||||||
'clear': function() {
|
'clear': function() {
|
||||||
@@ -23,4 +28,16 @@ app.run(function() {
|
|||||||
return app.get('expression').parse(input);
|
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