diff --git a/js/.gitignore b/js/.gitignore deleted file mode 100644 index 7ba0ce8c40d..00000000000 --- a/js/.gitignore +++ /dev/null @@ -1 +0,0 @@ -pkp.min.js \ No newline at end of file diff --git a/js/classes/VueRegistry.js b/js/classes/VueRegistry.js index 774ba6504f4..993711ce464 100644 --- a/js/classes/VueRegistry.js +++ b/js/classes/VueRegistry.js @@ -11,7 +11,6 @@ * @brief Registry and initialization class for Vue.js handlers */ export default { - /** * Registry of all active vue instances */ @@ -29,10 +28,8 @@ export default { * @param object The data object to pass to the controller. Can include * configuration parameters, translatable strings and initial data. */ - init: function (id, type, data) { - + init: function(id, type, data) { if (pkp.controllers[type] === undefined) { - console.log('No Vue of the type ' + type + ' could be found.'); return; } @@ -41,24 +38,23 @@ export default { delete data._constants; } - var args = _.extend({}, pkp.controllers[type], - { - el: '#' + id, - data: _.extend(pkp.controllers[type].data(), data, { id: id }), - } - ); + var args = $.extend(true, {}, pkp.controllers[type], { + el: '#' + id, + data: $.extend(true, {}, pkp.controllers[type].data(), data, {id: id}) + }); pkp.registry._instances[id] = new pkp.Vue(args); // Register with a parent handler from the legacy JS framework, so that // those componments can destroy a Vue instance when removing HTML code var $parents = $(pkp.registry._instances[id].$el).parents(); - $parents.each(function (i) { + $parents.each(function(i) { if ($.pkp.classes.Handler.hasHandler($($parents[i]))) { - $.pkp.classes.Handler.getHandler($($parents[i])) - .handlerChildren_.push(pkp.registry._instances[id]); + $.pkp.classes.Handler.getHandler($($parents[i])).handlerChildren_.push( + pkp.registry._instances[id] + ); return false; // only attach to the closest parent handler } }); - }, + } }; diff --git a/js/load.js b/js/load.js index 9f064eb710f..4b1b79172cd 100644 --- a/js/load.js +++ b/js/load.js @@ -34,19 +34,18 @@ export default { * @param int|array roles The role ID to look for (pkp.const.ROLE_ID...) * @return bool */ - userHasRole: function (roles) { - + userHasRole: function(roles) { if (!Array.isArray(roles)) { roles = [roles]; } var hasRole = false; - roles.forEach((role) => { + roles.forEach(role => { if ($.pkp.currentUser.accessRoles.indexOf(role) > -1) { hasRole = true; } }); return hasRole; - }, + } };