Sha256: 74905745ae1227380ca31727d2270294dab3c13080d5f483cb5046d4e63f2502

Contents?: true

Size: 1.67 KB

Versions: 1

Compression:

Stored size: 1.67 KB

Contents

/*!
 * froala_editor v3.0.0-rc.2 (https://www.froala.com/wysiwyg-editor)
 * License https://froala.com/wysiwyg-editor/terms/
 * Copyright 2014-2019 Froala Labs
 */

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],e):e(t.FroalaEditor)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t["default"]:t,Object.assign(t.DEFAULTS,{editInPopup:!1}),t.MODULES.editInPopup=function(n){function e(){n.events.$on(n.$el,n._mouseup,function(){setTimeout(function(){var t,e;e=n.popups.get("text.edit"),t="INPUT"===n.el.tagName?n.$el.attr("placeholder"):n.$el.text(),e.find("input").val(t).trigger("change"),n.popups.setContainer("text.edit",n.$sc),n.popups.show("text.edit",n.$el.offset().left+n.$el.outerWidth()/2,n.$el.offset().top+n.$el.outerHeight(),n.$el.outerHeight())},10)})}return{_init:function(){var t;n.opts.editInPopup&&(t={edit:'<div id="fr-text-edit-'.concat(n.id,'" class="fr-layer fr-text-edit-layer"><div class="fr-input-line"><input type="text" placeholder="').concat(n.language.translate("Text"),'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="updateText" tabIndex="2">').concat(n.language.translate("Update"),"</button></div></div>")},n.popups.create("text.edit",t),e())},update:function(){var t=n.popups.get("text.edit").find("input").val();0===t.length&&(t=n.opts.placeholderText),"INPUT"===n.el.tagName?n.$el.attr("placeholder",t):n.$el.text(t),n.events.trigger("contentChanged"),n.popups.hide("text.edit")}}},t.RegisterCommand("updateText",{focus:!1,undo:!1,callback:function(){this.editInPopup.update()}})});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wysiwyg-rails-3.0.0.pre.rc.2 app/assets/javascripts/plugins/edit_in_popup.min.js