diff --git a/lib/components/dialog/dialog.js b/lib/components/dialog/dialog.js index 972e528..47cc104 100644 --- a/lib/components/dialog/dialog.js +++ b/lib/components/dialog/dialog.js @@ -92,9 +92,7 @@ Dialog.prototype.render = function(options){ el.find('p').replaceWith(msg.el || msg); } - setTimeout(function(){ - el.removeClass('hide'); - }, 0); + el.removeClass('hide'); }; /** @@ -187,8 +185,6 @@ Dialog.prototype.escapable = function(){ Dialog.prototype.show = function(){ var overlay = this._overlay; - this.emit('show'); - if (overlay) { overlay.show(); this.el.addClass('modal'); diff --git a/lib/components/menu/menu.js b/lib/components/menu/menu.js index 63a5e39..fa268eb 100644 --- a/lib/components/menu/menu.js +++ b/lib/components/menu/menu.js @@ -136,7 +136,7 @@ Menu.prototype.move = function(direction){ Menu.prototype.add = function(text, fn){ var self = this , el = $('
  • ' + text + '
  • ') - .addClass(slug(text)) + .addClass(slug($('
    ', { html: text }).text())) .appendTo(this.el) .click(function(e){ e.preventDefault(); @@ -233,6 +233,8 @@ Menu.prototype.hide = function(){ function slug(str) { return str .toLowerCase() - .replace(/ +/g, '-') + .replace(/^\s*/, '') + .replace(/\s*$/, '') + .replace(/\s+/g, '-') .replace(/[^a-z0-9-]/g, ''); }