X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=ang%2FcrmUi.js;h=482264bf25f57f0c33390b959825382b12cbb860;hb=e72fdb99214ecacd79fd297e14d2c86fd368e6c2;hp=b01e897d3fde78b17f01281fef5f3e254784d9ab;hpb=6cfe1eeb6c2001553e531cafd09ef40be5634046;p=civicrm-core.git
diff --git a/ang/crmUi.js b/ang/crmUi.js
index b01e897d3f..482264bf25 100644
--- a/ang/crmUi.js
+++ b/ang/crmUi.js
@@ -1,7 +1,9 @@
/// crmUi: Sundry UI helpers
(function (angular, $, _) {
- var uidCount = 0;
+ var uidCount = 0,
+ pageTitle = 'CiviCRM',
+ documentTitle = 'CiviCRM';
angular.module('crmUi', [])
@@ -395,7 +397,7 @@
ngModel.$render = function(value) {
editor.done(function() {
- CRM.wysiwyg.setVal(elm, ngModel.$viewValue);
+ CRM.wysiwyg.setVal(elm, ngModel.$viewValue || '');
});
};
}
@@ -586,7 +588,7 @@
$timeout(function () {
// ex: msg_template_id adds new item then selects it; use $timeout to ensure that
// new item is added before selection is made
- element.select2('val', ngModel.$viewValue);
+ element.select2('val', ngModel.$modelValue);
});
};
}
@@ -629,7 +631,7 @@
$timeout(function () {
// ex: msg_template_id adds new item then selects it; use $timeout to ensure that
// new item is added before selection is made
- element.select2('val', ngModel.$viewValue);
+ element.select2('val', ngModel.$modelValue);
});
};
function refreshModel() {
@@ -730,6 +732,7 @@
})
// example:
...
...
+ // example with custom nav classes:
...
// Note: "myWizardCtrl" has various actions/properties like next() and $first().
// WISHLIST: Allow each step to determine if it is "complete" / "valid" / "selectable"
// WISHLIST: Allow each step to enable/disable (show/hide) itself
@@ -737,7 +740,8 @@
return {
restrict: 'EA',
scope: {
- crmUiWizard: '@'
+ crmUiWizard: '@',
+ crmUiWizardNavClass: '@'
},
templateUrl: '~/crmUi/wizard.html',
transclude: true,
@@ -867,6 +871,7 @@
// example:
...content...
// If there are any conditional steps, then be sure to set a weight explicitly on *all* steps to maintain ordering.
// example:
...content...
+ // example with custom classes:
...content...
.directive('crmUiWizardStep', function() {
var nextWeight = 1;
return {
@@ -875,8 +880,9 @@
scope: {
crmTitle: '@', // expression, evaluates to a printable string
crmUiWizardStep: '@' // int, a weight which determines the ordering of the steps
+ crmUiWizardStepClass: '@' // int, a weight which determines the ordering of the steps
},
- template: '',
+ template: '',
transclude: true,
link: function (scope, element, attrs, ctrls) {
var crmUiWizardCtrl = ctrls[0], form = ctrls[1];
@@ -889,7 +895,7 @@
return form.$valid;
};
crmUiWizardCtrl.add(scope);
- element.on('$destroy', function(){
+ scope.$on('$destroy', function(){
crmUiWizardCtrl.remove(scope);
});
}
@@ -975,6 +981,39 @@
}
};
})
+
+ // Sets document title & page title; attempts to override CMS title markup for the latter
+ // WARNING: Use only once per route!
+ // Example (same title for both):