Skip to content

Commit

Permalink
Fixed an bug where if the console did not define a welcome message, t…
Browse files Browse the repository at this point in the history
…he first line would never reset properly.
  • Loading branch information
spratt committed Jun 15, 2010
1 parent db84a4e commit f680bb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions demo.html
Expand Up @@ -12,7 +12,7 @@
/* First console */
var console1 = $('<div class="console1">');
$('body').append(console1);
console1.console({
var controller1 = console1.console({
promptLabel: 'Demo> ',
commandValidate:function(line){
if (line == "") return false;
Expand Down Expand Up @@ -57,7 +57,7 @@
var console3CancelFlag = false;
var console3 = $('<div class="console3">');
$('body').append(console3);
console3.console({
var controller3 = console3.console({
promptLabel: 'Echo> ',
commandValidate:function(line){
if (line == "") return false;
Expand Down
7 changes: 4 additions & 3 deletions jquery.console.js
Expand Up @@ -152,12 +152,13 @@
////////////////////////////////////////////////////////////////////////
// Reset terminal
extern.reset = function(){
var welcome = true;
var welcome = (typeof config.welcomeMessage != 'undefined');
inner.parent().fadeOut(function(){
inner.find('div').each(function(){
if (!welcome)
if (!welcome) {
$(this).remove();
welcome = false;
welcome = false;
}
});
newPromptBox();
inner.parent().fadeIn(function(){
Expand Down

0 comments on commit f680bb4

Please sign in to comment.