From c038df13dfa69bc6b56ca008660eea074f65803a Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 18 Jun 2021 16:27:10 -0700 Subject: [PATCH] msgtplui - (REF) ListCtrl - More consistent variable name It's a little confusing that .html uses `$ctrl` while JS uses `ctrl`. Just use `$ctrl` for both.# On branch master --- ext/msgtplui/ang/msgtplui/ListCtrl.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/msgtplui/ang/msgtplui/ListCtrl.js b/ext/msgtplui/ang/msgtplui/ListCtrl.js index b8a0d716e6..7676785a0e 100644 --- a/ext/msgtplui/ang/msgtplui/ListCtrl.js +++ b/ext/msgtplui/ang/msgtplui/ListCtrl.js @@ -31,8 +31,8 @@ default: {text: ''} }); - var ctrl = this; - ctrl.records = _.map( + var $ctrl = this; + $ctrl.records = _.map( [].concat(prefetch.records, _.map(prefetch.translations || [], simpleKeys)), function(r) { r._is_translation = (r.tx_language !== undefined); @@ -46,7 +46,7 @@ * @param variant - One of null 'legacy', 'current', 'draft'. (If null, then 'current'.) * @returns {string} */ - ctrl.editUrl = function(record, variant) { + $ctrl.editUrl = function(record, variant) { if (variant === 'legacy') { return CRM.url('civicrm/admin/messageTemplates/add', {action: 'update', id: record.id, reset: 1}); } @@ -60,14 +60,14 @@ return url; }; - ctrl.delete = function (record) { + $ctrl.delete = function (record) { var q = crmApi4('MessageTemplate', 'delete', {where: [['id', '=', record.id]]}).then(function(){ $route.reload(); }); return crmStatus({start: ts('Deleting...'), success: ts('Deleted')}, q); }; - ctrl.toggle = function (record) { + $ctrl.toggle = function (record) { var wasActive = !!record.is_active; var q = crmApi4('MessageTemplate', 'update', {where: [['id', '=', record.id]], values: {is_active: !wasActive}}) .then(function(resp){ -- 2.25.1