Skip to content

Commit

Permalink
Merge pull request #9 from punkave/hotfix/no-arrows
Browse files Browse the repository at this point in the history
Remove arrow functions to avoid apostrophe asset minifiy errors. Bump…
  • Loading branch information
mtthwmnc authored Aug 8, 2019
2 parents b3063cd + 947326a commit d15bdfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pk-people",
"version": "1.1.0",
"version": "1.1.1",
"description": "A base class for people in ApostropheCMS",
"main": "index.js",
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions public/js/editor-modal.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apos.define('pk-people-editor-modal', {
extend: 'apostrophe-pieces-editor-modal',
construct: (self, options) => {
construct: function (self, options) {
const superBeforeShow = self.beforeShow;
self.beforeShow = (callback) => {
return superBeforeShow((err) => {
self.beforeShow = function (callback) {
return superBeforeShow(function (err) {
if (err) {
return callback(err);
}
Expand All @@ -12,15 +12,15 @@ apos.define('pk-people-editor-modal', {
});
};

self.enableTitleViaName = () => {
self.enableTitleViaName = function () {
self.$title = apos.schemas.findField(self.$el, 'title');
self.$firstName = apos.schemas.findField(self.$el, 'firstName');
self.$lastName = apos.schemas.findField(self.$el, 'lastName');
self.$firstName.on('change', self.updateTitleViaName);
self.$lastName.on('change', self.updateTitleViaName);
};

self.updateTitleViaName = () => {
self.updateTitleViaName = function () {
self.$title.val((self.$firstName.val() + ' ' + self.$lastName.val()).trim());
self.$title.trigger('change');
self.$title.trigger('textchange');
Expand Down

0 comments on commit d15bdfc

Please sign in to comment.