Skip to content
This repository was archived by the owner on Dec 13, 2021. It is now read-only.

Commit 8c04f9f

Browse files
committed
Replaced the help text with Umbraco's umb-tooltip directive
1 parent 5c5d203 commit 8c04f9f

File tree

3 files changed

+38
-15
lines changed

3 files changed

+38
-15
lines changed

src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/css/innercontent.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/*
22
Inner Content - Doc Type Picker
33
*/
4-
.inner-content__doctypepicker table input, .inner-content__doctypepicker table select {
4+
5+
.inner-content__doctypepicker table input,
6+
.inner-content__doctypepicker table select {
57
width: 100%;
68
padding-right: 0;
79
}
810

9-
.inner-content__doctypepicker table td.icon-navigation, .inner-content__doctypepicker i.inner-content__help-icon {
11+
.inner-content__doctypepicker table td.icon-navigation,
12+
.inner-content__doctypepicker i.inner-content__help-icon {
1013
vertical-align: middle;
1114
color: #CCC;
1215
}
1316

14-
.inner-content__doctypepicker table td.icon-navigation:hover, .inner-content__doctypepicker i.inner-content__help-icon:hover {
17+
.inner-content__doctypepicker table td.icon-navigation:hover,
18+
.inner-content__doctypepicker i.inner-content__help-icon:hover {
1519
color: #343434;
1620
}
1721

18-
.inner-content__doctypepicker i.inner-content__help-icon {
19-
margin-left: 10px;
20-
}
21-
2222
.inner-content__doctypepicker table .td-min {
2323
width: 1px;
2424
}

src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/js/innercontent.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ angular.module("umbraco").controller("Our.Umbraco.InnerContent.Controllers.DocTy
99
var vm = this;
1010
vm.add = add;
1111
vm.remove = remove;
12+
vm.tooltipMouseOver = tooltipMouseOver;
13+
vm.tooltipMouseLeave = tooltipMouseLeave;
14+
1215
vm.sortableOptions = {
1316
axis: "y",
1417
containment: "parent",
@@ -22,6 +25,12 @@ angular.module("umbraco").controller("Our.Umbraco.InnerContent.Controllers.DocTy
2225
}
2326
};
2427

28+
vm.tooltip = {
29+
show: false,
30+
event: null,
31+
content: null
32+
};
33+
2534
innerContentService.getAllContentTypes().then(function (docTypes) {
2635
vm.docTypes = docTypes;
2736
});
@@ -36,14 +45,29 @@ angular.module("umbraco").controller("Our.Umbraco.InnerContent.Controllers.DocTy
3645
icContentTypeGuid: "",
3746
nameTemplate: ""
3847
});
48+
setDirty();
3949
};
4050

4151
function remove(index) {
4252
$scope.model.value.splice(index, 1);
53+
setDirty();
4354
};
4455

56+
function tooltipMouseOver($event) {
57+
vm.tooltip = {
58+
show: true,
59+
event: $event,
60+
content: $event.currentTarget.dataset.tooltip
61+
};
4562
};
4663

64+
function tooltipMouseLeave() {
65+
vm.tooltip = {
66+
show: false,
67+
event: null,
68+
content: null
69+
};
70+
};
4771

4872
function setDirty() {
4973
if ($scope.propertyForm) {

src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/views/innercontent.doctypepicker.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
</th>
1010
<th>
1111
Name Template
12+
<i class="icon icon-help-alt inner-content__help-icon"
13+
data-tooltip="Enter an angularjs expression to evaluate against each item for its name."
14+
ng-mouseover="vm.tooltipMouseOver($event)"
15+
ng-mouseleave="vm.tooltipMouseLeave()"></i>
1216
</th>
1317
<th class="td-min" ng-show="model.value.length > 1" />
1418
</tr>
@@ -31,14 +35,9 @@
3135
</table>
3236
<div>
3337
<a href="" class="btn" ng-click="vm.add()">Add</a>
34-
<i class="icon icon-help-alt medium inner-content__help-icon" ng-click="showHelpText = !showHelpText"></i>
3538
</div>
3639
</div>
37-
<br />
38-
<div class="inner-content__help-text" ng-show="showHelpText">
39-
<p>
40-
<b>Name template:</b><br />
41-
Enter an angular expression to evaluate against each item for its name.
42-
</p>
43-
</div>
40+
<umb-tooltip ng-if="vm.tooltip.show" event="vm.tooltip.event">
41+
{{vm.tooltip.content}}
42+
</umb-tooltip>
4443
</div>

0 commit comments

Comments
 (0)