UNPKG

ferngully-aurelia-tools

Version:

Ferngully Tools for Aurelia

73 lines 3.82 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", "./editable-inline-input.css"], function (require, exports, aurelia_framework_1, editable_input_element_service_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var EditableInlineInput = (function () { function EditableInlineInput(editableInputElementService) { this.editableInputElementService = editableInputElementService; this.classEx = null; } EditableInlineInput.prototype.bind = function () { this.editableInputElementService.editor = $(this.textbox); if (this.classEx) { this.editableInputElementService.editor.addClass(this.classEx); } }; EditableInlineInput.prototype.show = function (element, data, currentValue, onKeyPress, onSave) { this.editableInputElementService._show(element); this.editableInputElementService.value = currentValue; var textbox = $(this.textbox); textbox.focus(); textbox.select(); textbox.on("keydown.editable-inline-input", onKeyPress); textbox.on("blur.editable-inline-input", onSave); }; EditableInlineInput.prototype.hide = function () { this.editableInputElementService._hide(); var textbox = $(this.textbox); textbox.off("keydown.editable-inline-input"); textbox.off("blur.editable-inline-input"); }; Object.defineProperty(EditableInlineInput.prototype, "value", { get: function () { return this.editableInputElementService.value; }, enumerable: true, configurable: true }); Object.defineProperty(EditableInlineInput.prototype, "maxLength", { get: function () { return this.editableInputElementService.maxLength; }, enumerable: true, configurable: true }); EditableInlineInput.prototype.detached = function () { this.editableInputElementService.detached(); }; EditableInlineInput.prototype.attached = function () { this.editableInputElementService.attached(); }; __decorate([ aurelia_framework_1.bindable, __metadata("design:type", Object) ], EditableInlineInput.prototype, "classEx", void 0); EditableInlineInput = __decorate([ aurelia_framework_1.containerless, aurelia_framework_1.autoinject, aurelia_framework_1.customElement('editable-inline-input'), __metadata("design:paramtypes", [editable_input_element_service_1.EditableInputElementService]) ], EditableInlineInput); return EditableInlineInput; }()); exports.EditableInlineInput = EditableInlineInput; }); //# sourceMappingURL=editable-inline-input.js.map