Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WYSIWYG directive for xeditable using textAngular
angular.module('xeditable').directive('editableTextAngular', ['editableDirectiveFactory',
function (editableDirectiveFactory) {
return editableDirectiveFactory({
directiveName: 'editableTextAngular',
inputTpl: '<div text-angular></div>',
addListeners: function () {
var self = this;
self.parent.addListeners.call(self);
// submit textarea by ctrl+enter even with buttons
if (self.single && self.buttons !== 'no') {
self.autosubmit();
}
},
autosubmit: function () {
var self = this;
self.inputEl.bind('keydown', function (e) {
if ((e.ctrlKey || e.metaKey) && (e.keyCode === 13)) {
self.scope.$apply(function () {
self.scope.$form.$submit();
});
}
});
}
});
}]);
@jjgonver

This comment has been minimized.

Copy link

@jjgonver jjgonver commented Aug 22, 2016

Hi. Any documentation with instructions how to use it? Thanks

@jjgonver

This comment has been minimized.

Copy link

@jjgonver jjgonver commented Aug 23, 2016

image

@jjgonver

This comment has been minimized.

Copy link

@jjgonver jjgonver commented Sep 1, 2016

Hi.
The text container goes to infinity in edit mode.
Do you know how to resolve this?
Thanks

@uofmmike

This comment has been minimized.

Copy link

@uofmmike uofmmike commented Sep 7, 2017

Just wanted to give some thanks, great little directive you've given here! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment