-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
943a429
commit 1066dec
Showing
7 changed files
with
83 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
bundle/src/main/resources/angularjs-partials/descriptionPopup.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<div class="caconfig-description-popup" bindonce="descriptionPopupReady"> | ||
<div bindonce="descriptionPopupReady"> | ||
<button is="coral-button" bo-id="id" variant="minimal" icon="infoCircle" iconsize="M"></button> | ||
<coral-popover placement="left" bo-attr bo-attr-target="'#' + id"></coral-popover> | ||
</div> |
4 changes: 4 additions & 0 deletions
4
bundle/src/main/resources/angularjs-partials/helpInlinePopup.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span class="caconfig-help-inline-popup" bindonce="helpInlinePopupReady"> | ||
<button is="coral-button" bo-id="id" variant="minimal" icon="infoCircle" iconsize="S"></button> | ||
<coral-popover placement="right" bo-attr bo-attr-target="'#' + id"></coral-popover> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
...bapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/help-inline-popup.directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* #%L | ||
* wcm.io | ||
* %% | ||
* Copyright (C) 2024 wcm.io | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
(function (angular, Coral) { | ||
"use strict"; | ||
|
||
/** | ||
* Directive to render the "i" button with a popover for the decription of the property. | ||
* Wraps a Coral UI Button and Coral.Popover widget. | ||
* This directive transcludes the popup content elements. | ||
* | ||
* @example | ||
* <caconfig-description-popup> | ||
* <caconfig-popup-content content="Description Text"> | ||
* </caconfig-popup-content> | ||
* </caconfig-description-popup> | ||
*/ | ||
angular.module("io.wcm.caconfig.widgets") | ||
.directive("caconfigHelpInlinePopup", helpInlinePopup); | ||
|
||
helpInlinePopup.$inject = ["$timeout", "templateUrlList"]; | ||
|
||
function helpInlinePopup($timeout, templateList) { | ||
|
||
var directive = { | ||
restrict: "E", | ||
replace: true, | ||
templateUrl: templateList.helpInlinePopup, | ||
link: link, | ||
scope: { | ||
content: "=" | ||
} | ||
}; | ||
|
||
return directive; | ||
|
||
function link(scope, element) { | ||
scope.id = Coral.commons.getUID(); | ||
|
||
scope.$evalAsync(function () { | ||
scope.helpInlinePopupReady = true; | ||
}); | ||
|
||
$timeout(function() { | ||
var $popover = element.find("coral-popover"); | ||
var popover = $popover[0]; | ||
Coral.commons.ready(popover, function() { | ||
$popover.append($('<p class="u-coral-margin"></p>').text(scope.content)); | ||
}); | ||
}, false); | ||
} | ||
} | ||
}(angular, Coral)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters