Notice: Undefined offset: 1 in /home/plusensd/steelhammer.com.ua/route.php on line 89
$(function() {
$("body").on("focus", "[contenteditable]", function() {
var $this = $(this);
$this.data("before", $this.html());
$this.data("previous", $this.html());
$this.data("changed", false);
return $this;
}).on("blur keyup paste input", "[contenteditable]", function() {
var $this = $(this);
if ($this.data("previous") !== $this.html()) {
$this.data("previous", $this.html());
$this.data("changed", true);
$this.trigger("change");
}
return $this;
}).on("blur", "[contenteditable]", function() {
var $this = $(this);
if ($this.data("changed") && confirm("Сохранить изменения?")) {
$this.trigger("savechanges");
} else {
$this.html($this.data("before"));
}
return $this;
}).on("dropbox", "[contenteditable]", function(e) {
var $this = $(this);
$(this).data("dropbox").ForEach(function(image) {
$this.append($("", { src: image }));
});
});
});