You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
608 B
25 lines
608 B
define(["app/dom", "app/i18n"], function($, i18n) {
|
|
|
|
"use strict";
|
|
|
|
return function(el) {
|
|
el.setAttribute("contentEditable", true);
|
|
|
|
el.on("focus", function() {
|
|
if (el.classList.contains("placeholder")) {
|
|
el.innerHTML = "";
|
|
el.classList.remove("placeholder");
|
|
}
|
|
});
|
|
|
|
el.on("blur", function() {
|
|
if (el.textContent.length === 0) {
|
|
el.textContent = i18n.translate("postbox-text");
|
|
el.classList.add("placeholder");
|
|
}
|
|
});
|
|
|
|
return el;
|
|
};
|
|
|
|
}); |