-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery-editable.js
1 lines (1 loc) · 1.68 KB
/
jquery-editable.js
1
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jQueryEditable=e()}(function(){return function o(i,r,f){function u(t,e){if(!r[t]){if(!i[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(p)return p(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}n=r[t]={exports:{}},i[t][0].call(n.exports,function(e){return u(i[t][1][e]||e)},n,n.exports,o,i,r,f)}return r[t].exports}for(var p="function"==typeof require&&require,e=0;e<f.length;e++)u(f[e]);return u}({1:[function(e,t,n){function o(i){if(1<this.length)return this.each(function(){$(this).editable(i)});function t(e,t){var n=(e=$(e)).val().trim(),o=null;(t=n?t:t||!0)||n===r||(o=i.onChange.call(f,n,r)),t||!1===o?e.parent().text(r):(n=o||e.val()||r,e.parent().text(n)),e.remove()}(i=i||{}).onChange=i.onChange||function(){},i.inputHTML=i.inputHTML||"<input type='text'>";var r,f=this;("parent"===i.clickTarget?f.parent():f).on("dblclick",function(){r=f.text(),f.text("");var e=$(i.inputHTML);e.appendTo(f),e.focus().val(r)}),f.on("keyup","input",function(e){13===e.keyCode&&t(this),27===e.keyCode&&t(this,!0)}),f.on("focusout","input",function(e){t(this)})}"undefined"!=typeof window&&void 0!==window.$&&($.fn.editable=o),t.exports=o},{}]},{},[1])(1)});