!function () { "use strict"; angular.module("gg.editableText", []) }(), function () { "use strict"; angular.module("gg.editableText").directive("editableText", ["EditableTextHelper", function (a) { return { scope: { editableText: "=", editMode: "=", placeholder: "@", onChange: "&" }, transclude: !0, template: '{{placeholder ? (editingValue ? editingValue : placeholder) : editingValue}}' + a.workingText + "", link: function (a, b, c) { var d, e = b.find("input"); a.isEditing = !!a.editMode, a.editingValue = a.editableText, b.addClass("gg-editable-text"), a.$watch("isEditing", function (f, g) { var h, i = e[0]; void 0 !== c.editMode && (a.editMode = f), b[f ? "addClass" : "removeClass"]("editing"), f ? (i.focus(), i.selectionStart = i.selectionEnd = a.editingValue ? a.editingValue.length : 0) : c.onChange && f !== g && a.editingValue != d ? (h = a.onChange({ value: a.editingValue }), h && h.then ? (a.isWorking = !0, h.then(function (b) { a.editableText = a.editingValue = b, a.isWorking = !1 }, function () { a.editingValue = a.editableText, a.isWorking = !1 })) : h ? a.editableText = a.editingValue = h : a.editingValue = a.editableText) : a.editableText = a.editingValue }), a.$watch("editMode", function (b) { a.isEditing = !!b }), a.$watch("editableText", function (b) { d = b, a.editingValue = b }) } } }]) }(), function () { angular.module("gg.editableText").provider("EditableTextHelper", function () { var a = "Working..", b = ""; this.setWorkingText = function (b) { return a = b, this }, this.setWorkingClassName = function (a) { return b = a, this }, this.$get = function () { return { workingText: a, workingClassName: b } } }) }();