X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=ang%2FcrmUi.js;h=a66334015a256336d4a7bd7af57d51e46706544d;hb=45ebc194fde140aadea85aee7a47d71ad25d1c7d;hp=985edc291c32b8117e7d946f43c63e4b2a0e06e9;hpb=7e8899398c1e798d8da8aff05f6b86b72758a9bd;p=civicrm-core.git
diff --git a/ang/crmUi.js b/ang/crmUi.js
index 985edc291c..a66334015a 100644
--- a/ang/crmUi.js
+++ b/ang/crmUi.js
@@ -124,7 +124,7 @@
// example:
{{mydata}}
// example:
// example:
- // example: {{mydata}}
+ // example: {{mydata}}
.directive('crmUiField', function() {
// Note: When writing new templates, the "label" position is particular. See/patch "var label" below.
var templateUrls = {
@@ -255,7 +255,7 @@
// immediately for initialization. Use retries/retryDelay to initialize such elements.
var init = function (retries, retryDelay) {
var input = $('#' + id);
- if (input.length === 0) {
+ if (input.length === 0 && !attrs.crmUiForceRequired) {
if (retries) {
$timeout(function(){
init(retries-1, retryDelay);
@@ -264,6 +264,11 @@
return;
}
+ if (attrs.crmUiForceRequired) {
+ scope.crmIsRequired = true;
+ return;
+ }
+
var tgtScope = scope;//.$parent;
if (attrs.crmDepth) {
for (var i = attrs.crmDepth; i > 0; i--) {
@@ -326,6 +331,7 @@
link: function (scope, elm, attrs) {
var iframe = $(elm)[0];
iframe.setAttribute('width', '100%');
+ iframe.setAttribute('height', '250px');
iframe.setAttribute('frameborder', '0');
var refresh = function () {
@@ -355,6 +361,10 @@
iframe.setAttribute('height', '' + $(this).innerHeight() + 'px');
});
+ $(elm).parent().on('dialogresize', function(e, ui) {
+ iframe.setAttribute('class', 'resized');
+ });
+
scope.$parent.$watch(attrs.crmUiIframe, refresh);
}
};
@@ -788,11 +798,7 @@
};
this.isSelectable = function(step) {
if (step.selected) return false;
- var result = false;
- angular.forEach(steps, function(otherStep, otherKey) {
- if (step === otherStep && otherKey <= maxVisited) result = true;
- });
- return result;
+ return this.$validStep();
};
/*** @param Object step the $scope of the step */
@@ -1002,22 +1008,16 @@
scope: {
crmDocumentTitle: '='
},
- limit: 'ae',
link: function(scope, $el, attrs) {
function update() {
$timeout(function() {
var newPageTitle = _.trim($el.html()),
- newDocumentTitle = scope.crmDocumentTitle || $el.text(),
- cls = $el.attr('class').split(' '),
- classes = _.filter(cls, function(c) {
- return c.indexOf('ng-') !== 0;
- });
- classes.push('crm-page-title');
+ newDocumentTitle = scope.crmDocumentTitle || $el.text();
document.title = $('title').text().replace(documentTitle, newDocumentTitle);
// If the CMS has already added title markup to the page, use it
$('h1').not('.crm-container h1').each(function() {
if (_.trim($(this).html()) === pageTitle) {
- $(this).addClass(classes.join(' ')).html(newPageTitle);
+ $(this).addClass('crm-page-title').html(newPageTitle);
$el.hide();
}
});