Skip to content

Commit

Permalink
Merge pull request nextcloud#35785 from nextcloud/enh/35654-js-files/…
Browse files Browse the repository at this point in the history
…replace_custom_tooltips_with_native_one_for_files_sharing

Replace custom tooltips with native one for files sharing
  • Loading branch information
JuliaKirschenheuter authored Dec 23, 2022
2 parents 945afd4 + a67c53a commit 99382a0
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 21 deletions.
2 changes: 0 additions & 2 deletions apps/files_sharing/js/files_drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@
$('#drop-upload-progress-indicator').removeClass('hidden');

$('#drop-uploaded-files').append(output({isUploading: true, name: data.files[0].name}));
$('[data-toggle="tooltip"]').tooltip();
data.submit();

return true;
},

updateFileItem: function (fileName, fileItem) {
$('#drop-uploaded-files li[data-name="' + fileName + '"]').replaceWith(fileItem);
$('[data-toggle="tooltip"]').tooltip();
},

initialize: function () {
Expand Down
3 changes: 1 addition & 2 deletions apps/files_sharing/js/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ OCA.Sharing.PublicApp = {
// Toggle for grid view
this.$showGridView = $('input#showgridview');
this.$showGridView.on('change', _.bind(this._onGridviewChange, this));
$('#view-toggle').tooltip({placement: 'bottom', trigger: 'hover'});

var filesClient = new OC.Files.Client({
host: OC.getHost(),
Expand Down Expand Up @@ -380,7 +379,7 @@ OCA.Sharing.PublicApp = {
.removeClass('icon-toggle-filelist icon-toggle-pictures')
.addClass(isGridView ? 'icon-toggle-filelist' : 'icon-toggle-pictures')
this.$showGridView.next('#view-toggle').attr(
'data-original-title',
'title',
isGridView ? t('files', 'Show list view') : t('files', 'Show grid view'),
)

Expand Down
4 changes: 1 addition & 3 deletions apps/files_sharing/js/sharedfilelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@
'class': 'modified',
'title': formatted,
'style': 'color:rgb(' + modifiedColor + ',' + modifiedColor + ',' + modifiedColor + ')'
}).text(text)
.tooltip({ placement: 'top' })
)
}).text(text))

$tr.append(td)
}
Expand Down
8 changes: 4 additions & 4 deletions apps/files_sharing/js/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ templates['files_drop'] = template({"1":function(container,depth0,helpers,partia

return " <div id=\"drop-upload-name\">"
+ container.escapeExpression(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"name","hash":{},"data":data,"loc":{"start":{"line":3,"column":29},"end":{"line":3,"column":37}}}) : helper)))
+ "</div><div id=\"drop-upload-status\"></div>\n <progress id=\"drop-upload-progress-bar\" value=\"0\" max=\"100\"></progress> \n";
+ "</div><div id=\"drop-upload-status\"></div>\n <progress id=\"drop-upload-progress-bar\" value=\"0\" max=\"100\"></progress>\n";
},"3":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
Expand All @@ -32,10 +32,10 @@ templates['files_drop'] = template({"1":function(container,depth0,helpers,partia
return undefined
};

return "<li data-toggle=\"tooltip\" title=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41}}}) : helper)))
return "<li title=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}}) : helper)))
+ "\" data-name=\""
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":62}}}) : helper)))
+ alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":40}}}) : helper)))
+ "\">\n"
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isUploading") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data,"loc":{"start":{"line":2,"column":1},"end":{"line":7,"column":8}}})) != null ? stack1 : "")
+ "</li>\n";
Expand Down
4 changes: 2 additions & 2 deletions apps/files_sharing/js/templates/files_drop.handlebars
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<li data-toggle="tooltip" title="{{name}}" data-name="{{name}}">
<li title="{{name}}" data-name="{{name}}">
{{#if isUploading}}
<div id="drop-upload-name">{{name}}</div><div id="drop-upload-status"></div>
<progress id="drop-upload-progress-bar" value="0" max="100"></progress>
<progress id="drop-upload-progress-bar" value="0" max="100"></progress>
{{else}}
<img src="{{iconSrc}}"/> {{name}}
{{/if}}
Expand Down
2 changes: 0 additions & 2 deletions apps/files_sharing/src/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ import { getCapabilities } from '@nextcloud/capabilities'
avatarElement.each(function() {
$(this).avatar($(this).data('username'), 32)
})
action.find('span[title]').tooltip({ placement: 'top' })
}
} else {
action.html('<span class="hidden-visually">' + t('files_sharing', 'Shared') + '</span>').prepend(icon)
Expand Down Expand Up @@ -511,7 +510,6 @@ import { getCapabilities } from '@nextcloud/capabilities'
avatarElement.each(function() {
$(this).avatar($(this).data('username'), 32)
})
action.find('span[title]').tooltip({ placement: 'top' })
}
} else {
action.html('<span class="hidden-visually">' + t('files_sharing', 'Shared') + '</span>').prepend(icon)
Expand Down
4 changes: 2 additions & 2 deletions dist/files_sharing-additionalScripts.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-additionalScripts.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing.js.map

Large diffs are not rendered by default.

0 comments on commit 99382a0

Please sign in to comment.