Skip to content
Browse files

Make placeholder logic smarter (fixes #110)

  • Loading branch information...
1 parent e090eec commit ecb0a296e412fbdf12530b082f6b1a0578b07e7b @tiff tiff committed Jun 15, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 src/dom/simulate_placeholder.js
  2. +1 −1 src/views/composer.js
View
2 src/dom/simulate_placeholder.js
@@ -19,10 +19,12 @@
if (view.hasPlaceholderSet()) {
view.clear();
}
+ view.placeholderSet = false;
dom.removeClass(view.element, CLASS_NAME);
},
set = function() {
if (view.isEmpty()) {
+ view.placeholderSet = true;
view.setValue(placeholderText);
dom.addClass(view.element, CLASS_NAME);
}
View
2 src/views/composer.js
@@ -92,7 +92,7 @@
},
hasPlaceholderSet: function() {
- return this.getTextContent() == this.textarea.element.getAttribute("placeholder");
+ return this.getTextContent() == this.textarea.element.getAttribute("placeholder") && this.placeholderSet;
},
isEmpty: function() {

0 comments on commit ecb0a29

Please sign in to comment.
Something went wrong with that request. Please try again.