UNPKG

ferngully-aurelia-tools

Version:

Ferngully Tools for Aurelia

78 lines 4.21 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; define(["require", "exports", "aurelia-framework", "../editable-input-element-service", "../../../services/browser-service", "./editable-inline-textarea.css"], function (require, exports, aurelia_framework_1, editable_input_element_service_1, browser_service_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EditableInlineTextArea = (function () { function EditableInlineTextArea(editableInputElementService, browserService) { this.editableInputElementService = editableInputElementService; this.browserService = browserService; this.classEx = null; this.encode = true; } EditableInlineTextArea.prototype.bind = function () { this.editableInputElementService.editor = $(this.textbox); if (this.classEx) { this.editableInputElementService.editor.addClass(this.classEx); } }; EditableInlineTextArea.prototype.show = function (element, config, currentValue, onKeyPress, onSave) { var textbox = $(this.textbox); this.encode = config.Encode; textbox.attr("rows", config.Rows); this.textbox.value = this.browserService.unEscapeHtml(currentValue); this.editableInputElementService._show(element); textbox.focus(); textbox.select(); textbox.on("keydown.editable-inline-textarea", onKeyPress); textbox.on("blur.editable-inline-textarea", onSave); }; EditableInlineTextArea.prototype.hide = function () { this.editableInputElementService._hide(); var textbox = $(this.textbox); textbox.off("keydown.editable-inline-textarea"); textbox.off("blur.editable-inline-textarea"); }; Object.defineProperty(EditableInlineTextArea.prototype, "value", { get: function () { return this.browserService.escapeHtml(this.textbox.value); }, enumerable: true, configurable: true }); Object.defineProperty(EditableInlineTextArea.prototype, "maxLength", { get: function () { return this.editableInputElementService.maxLength; }, enumerable: true, configurable: true }); EditableInlineTextArea.prototype.detached = function () { this.editableInputElementService.detached(); }; EditableInlineTextArea.prototype.attached = function () { this.editableInputElementService.attached(); }; __decorate([ aurelia_framework_1.bindable, __metadata("design:type", Object) ], EditableInlineTextArea.prototype, "classEx", void 0); EditableInlineTextArea = __decorate([ aurelia_framework_1.containerless, aurelia_framework_1.autoinject, aurelia_framework_1.customElement('editable-inline-textarea'), __metadata("design:paramtypes", [editable_input_element_service_1.EditableInputElementService, browser_service_1.BrowserService]) ], EditableInlineTextArea); return EditableInlineTextArea; }()); exports.EditableInlineTextArea = EditableInlineTextArea; }); //# sourceMappingURL=editable-inline-textarea.js.map