Skip to content

Commit 790b94a

Browse files
committed
REP-1057 migrates tooltips and filter check boxes
1 parent 463dab6 commit 790b94a

9 files changed

Lines changed: 28 additions & 25 deletions

File tree

mir-layout/src/main/resources/META-INF/resources/mir-layout/scss/common/base.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
letter-spacing: 0.4em;
6565
padding-left: 12px
6666
}
67+
68+
// all the elements that should have no underline by default
69+
.hit_title,
70+
.hit_author,
71+
.hit_source,
72+
.single_hit_option,
6773
.internal_links,
6874
.social_links {
6975
a {

mir-layout/src/main/resources/META-INF/resources/mir-layout/scss/common/mir_results.scss

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,8 @@ $hover_darken: 20%;
103103
.filter {
104104
li {
105105
cursor: pointer;
106-
&:hover * {
107-
background-color: transparent;
108-
}
109106
&:hover {
110-
.custom-checkbox {
107+
.form-check {
111108
label {
112109
.title {
113110
color: shade-color($filter, $hover_darken);
@@ -118,16 +115,16 @@ $hover_darken: 20%;
118115
}
119116
}
120117
}
121-
.custom-checkbox {
122-
margin-top: 0px;
123-
margin-bottom: 0px;
118+
.form-check {
124119
label {
125120
cursor: pointer;
126-
vertical-align: middle;
127121
.hits {
128122
color: $filter_hits;
129123
}
130124
}
125+
input {
126+
cursor: pointer;
127+
}
131128
}
132129
}
133130
}

mir-module/src/main/resources/META-INF/resources/js/epusta.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ EPuStaInline.prototype= {
4242
,render() {
4343
switch(this.state) {
4444
case "error":
45-
this.$element.html("<i class='fas fa-exclamation-triangle' data-toggle='tooltip' title='"+this.errortext+"'></i>");
45+
this.$element.html("<i class='fas fa-exclamation-triangle' data-bs-toggle='tooltip' title='"+this.errortext+"'></i>");
4646
break;
4747
case "waiting":
4848
this.$element.html("<i class='fas fa-spinner fa-pulse'></i>");
@@ -124,7 +124,7 @@ EPuStaGraph.prototype= {
124124
switch(this.state) {
125125
case "error":
126126
var html='<div style="with:100%;text-align:center;">';
127-
html+="<i class='fas fa-exclamation-triangle' data-toggle='tooltip' title='"+this.errortext+"'/>";
127+
html+="<i class='fas fa-exclamation-triangle' data-bs-toggle='tooltip' title='"+this.errortext+"'/>";
128128
html+=this.errortext;
129129
html+="</div>";
130130
this.$element.html(html);

mir-module/src/main/resources/META-INF/resources/js/jquery.search-entity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@
575575

576576
var $typeBtn = this.$typeBtn = $(document.createElement("button"));
577577
$typeBtn.addClass(options.buttonClass).addClass("dropdown-toggle");
578-
$typeBtn.attr("data-toggle", "dropdown");
578+
$typeBtn.attr("data-bs-toggle", "dropdown");
579579
$typeBtn.html("<span class=\"caret\"></span><span class=\"sr-only\">Toggle Dropdown</span>");
580580

581581
$actions.append($typeBtn);

mir-module/src/main/resources/META-INF/resources/js/mir/base.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
const i18nKey = ($(currentMd5Elements.get(0)).hasClass('hidden'))
370370
? ('component.mods.metaData.options.MD5.show')
371371
: ('component.mods.metaData.options.MD5.hide');
372-
372+
373373
// Get a current toggle element
374374
const currentToggleMD5LinkElement = $(currentDerivateIdParentElements.get(0)).find(toggleMD5LinkElement);
375375

@@ -689,10 +689,10 @@
689689
return true;
690690
};
691691

692-
$(document).tooltip({
693-
selector : "[data-toggle=tooltip]",
694-
container : "body"
695-
});
692+
// initiate bs tooltips
693+
// https://getbootstrap.com/docs/5.3/components/tooltips/#enable-tooltips
694+
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
695+
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
696696

697697
/* =================
698698
/ go back to top

mir-module/src/main/resources/META-INF/resources/js/mir/xeditor-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ $(document).ready(function() {
314314
});
315315

316316
$(document).popover({
317-
selector: "[data-toggle=popover]",
317+
selector: "[data-bs-toggle=popover]",
318318
container: "body",
319319
html: true,
320320
trigger: "focus"

mir-module/src/main/resources/xsl/editor/mir2xeditor.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</xsl:variable>
1919

2020
<xsl:template name="mir-helpbutton">
21-
<a tabindex="0" class="btn btn-secondary info-button" role="button" data-toggle="popover" data-placement="right" data-content="{@help-text}">
21+
<a tabindex="0" class="btn btn-secondary info-button" role="button" data-bs-toggle="popover" data-placement="right" data-content="{@help-text}">
2222
<i class="fas fa-info"></i>
2323
</a>
2424
</xsl:template>

mir-module/src/main/resources/xsl/response-facets.xsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
<xsl:value-of select="$facetProperties/properties/entry[@key=concat('MIR.Response.Facet.', $facet_name, '.Roles')]"/>
2727
</xsl:variable>
2828
<xsl:variable name="hasRole" select="string-length($rolesProperty)=0 or count(str:tokenize($rolesProperty,',')[mcrxsl:isCurrentUserInRole(.)])!=0"/>
29-
29+
3030
<xsl:if test="$isEnabled and $hasRole and self::node()[@name=$facet_name]/int">
31-
31+
3232
<xsl:variable name="classIdProperty">
3333
<xsl:value-of select="$facetProperties/properties/entry[@key=concat('MIR.Response.Facet.', $facet_name, '.ClassId')]"/>
3434
</xsl:variable>
@@ -174,16 +174,16 @@
174174
</xsl:variable>
175175

176176
<li data-fq="{$fqResponseValue}">
177-
<div class="custom-control custom-checkbox" onclick="location.href='{$queryURL}';">
178-
<input type="checkbox" class="custom-control-input">
177+
<div class="form-check" onclick="location.href='{$queryURL}';">
178+
<input type="checkbox" class="form-check-input">
179179
<xsl:if test="
180180
/response/lst[@name='responseHeader']/lst[@name='params']/str[@name='fq' and text() = $fqResponseValue] |
181181
/response/lst[@name='responseHeader']/lst[@name='params']/arr[@name='fq']/str[text() = $fqResponseValue]">
182182
<xsl:attribute name="checked">true</xsl:attribute>
183183
</xsl:if>
184184
</input>
185185

186-
<label class="custom-control-label">
186+
<label class="form-check-label">
187187
<span class="title">
188188
<xsl:choose>
189189
<xsl:when

mir-module/src/main/resources/xsl/xeditor-mir-templates.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,15 @@
367367
</xsl:if>
368368
</xsl:attribute>
369369

370-
<input class="custom-control-input" type="{$inputType}" value="{@value}" id="{$gId}">
370+
<input class="form-check-input" type="{$inputType}" value="{@value}" id="{$gId}">
371371
<xsl:if test="@disabled = 'true'">
372372
<xsl:attribute name="disabled">
373373
<xsl:text>disabled</xsl:text>
374374
</xsl:attribute>
375375
</xsl:if>
376376
<xsl:apply-templates select="." mode="inputOptions" />
377377
</input>
378-
<label class="custom-control-label" for="{$gId}">
378+
<label class="form-check-label" for="{$gId}">
379379
<xsl:if test="string-length(@i18n) &gt; 0">
380380
<xed:output i18n="{@i18n}" />
381381
</xsl:if>

0 commit comments

Comments
 (0)