Skip to content

Commit 33f00a5

Browse files
bergmaniaAndyButlandZeegaannielslyngsoenul800sebastiaan
authored
V9/feature/merge v8 22/11/2021 (#11681)
* Changes to GetReducedEventList (#11444) * Instead of only using first event, we combine events of same type into a single event with multiple arguments * Added generic method to DRY up grouping logic. * Renamed method to better reflect new functionality. Co-authored-by: Andy Butland <[email protected]> * Merge pull request #11360 from umbraco/v8/bugfix/11057-mandatory-image-not-validating-after-first-time-failure Fixes 11057: Mandatory Image not validating after first time failure (cherry picked from commit 5cc70d2) * Additional optional sanitization of scripting in TinyMCE (#10653) (cherry picked from commit f68dba7) * Bump version to 8.17.1 * Hide localization key while loading * ContentVersion cleanup backoffice UI (#11637) * init rollback ui prototype * add busy state to button, deselect version, add pagination status * add localisation * style current version * disable rollback button when nothing is selected * stop click event * Endpoints for paginated content versions. Light on tests, tight on time. * Endpoints to "pin" content versions * camel case json output. Not sure why json formatter not set for controller, bit risky to add it now * wire up paging * wire up pin/unpin * rename getPagedRollbackVersions to getPagedContentVersions * prevent selection of current version and current draft * add current draft and current version to UI * remove pointer if the row is not selectable * Improve warning for globally disabled cleanup feature. * Fix current loses prevent cleanup state on publish. * Added umbracoLog audit entries for "pin" / "unpin" * Match v9 defaults for keepVersions settings * Fix - losing preventCleanup on save current with content changes * update pin/unpin button labels * fix pagination bug * add missing " * always send culture when a doc type can vary Co-authored-by: Mads Rasmussen <[email protected]> * Bugfix - DocumentVersionRepository.Get should not join culture variation * Bugfix - Missing write lock * Bugfix - Policy returns items to delete not items to keep. Switch to inverse behavior. Co-authored-by: Andy Butland <[email protected]> Co-authored-by: Nikolaj Geisle <[email protected]> Co-authored-by: Niels Lyngsø <[email protected]> Co-authored-by: Sebastiaan Janssen <[email protected]> Co-authored-by: Ronald Barendse <[email protected]> Co-authored-by: Paul Johnson <[email protected]> Co-authored-by: Mads Rasmussen <[email protected]>
1 parent 579613c commit 33f00a5

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
angular.module("umbraco.directives")
2-
1+
angular.module('umbraco.directives')
32
/**
43
* @ngdoc directive
54
* @name umbraco.directives.directive:localize
@@ -8,12 +7,12 @@ angular.module("umbraco.directives")
87
* @description
98
* <div>
109
* <strong>Component</strong><br />
11-
* Localize a specific token to put into the HTML as an item
10+
* Localize a specific token to put into the HTML as an item.
1211
* </div>
1312
* <div>
1413
* <strong>Attribute</strong><br />
15-
* Add a HTML attribute to an element containing the HTML attribute name you wish to localise
16-
* Using the format of '@section_key' or 'section_key'
14+
* Add an HTML attribute to an element containing the HTML attribute name you wish to localize,
15+
* using the format of '@section_key' or 'section_key'.
1716
* </div>
1817
* ##Usage
1918
* <pre>
@@ -36,12 +35,11 @@ angular.module("umbraco.directives")
3635
watchTokens: '@'
3736
},
3837
replace: true,
39-
4038
link: function (scope, element, attrs) {
4139
var key = scope.key;
42-
scope.text = "";
40+
scope.text = '';
4341

44-
// A render function to be able to update tokens as values update.
42+
// A render function to be able to update tokens as values update
4543
function render() {
4644
element.html(localizationService.tokenReplace(scope.text, scope.tokens || null));
4745
}
@@ -50,26 +48,28 @@ angular.module("umbraco.directives")
5048
scope.text = value;
5149
render();
5250
});
51+
5352
if (scope.watchTokens === 'true') {
5453
scope.$watch("tokens", render, true);
5554
}
5655
}
5756
};
5857
})
59-
6058
.directive('localize', function ($log, localizationService) {
6159
return {
6260
restrict: 'A',
6361
link: function (scope, element, attrs) {
64-
//Support one or more attribute properties to update
62+
// Support one or more attribute properties to update
6563
var keys = attrs.localize.split(',');
6664

6765
Utilities.forEach(keys, (value, key) => {
6866
var attr = element.attr(value);
69-
7067
if (attr) {
68+
// Localizing is done async, so make sure the key isn't visible
69+
element.removeAttr(value);
70+
7171
if (attr[0] === '@') {
72-
//If the translation key starts with @ then remove it
72+
// If the translation key starts with @ then remove it
7373
attr = attr.substring(1);
7474
}
7575

@@ -82,5 +82,4 @@ angular.module("umbraco.directives")
8282
});
8383
}
8484
};
85-
8685
});

0 commit comments

Comments
 (0)