Browse Source

[FIX][11.0] website_img_dimension travis warnings

pull/481/head
tbaden 1 month ago
parent
commit
2b45786624
1 changed files with 14 additions and 12 deletions
  1. 14
    12
      website_img_dimension/static/src/js/website_img_dimension.tooltip.js

+ 14
- 12
website_img_dimension/static/src/js/website_img_dimension.tooltip.js View File

@@ -1,40 +1,42 @@
1
-odoo.define('website_img_dimension.tooltip', function(require) {
1
+odoo.define('website_img_dimension.tooltip', function (require) {
2 2
     "use strict";
3 3
     var Class = require('web.Class');
4 4
     var web_editor_base = require('web_editor.base');
5 5
 
6 6
     var TooltipManager = Class.extend({
7
-        init: function() {
7
+        init: function () {
8 8
             var self = this;
9
-            web_editor_base.ready().done(function() {
10
-                $('#wrap').on('mouseenter', 'img', function() {
9
+            web_editor_base.ready().done(function () {
10
+                $('#wrap').on('mouseenter', 'img', function () {
11 11
                     self.show_tooltip($(this));
12 12
                 });
13 13
 
14
-                $('#wrap').on('mouseleave', 'img', function() {
14
+                $('#wrap').on('mouseleave', 'img', function () {
15 15
                     self.hide_tooltip($(this));
16 16
                 });
17 17
             });
18 18
         },
19
-        get_title: function($img) {
20
-            return $img.width() + ' x ' + $img.height() + ' (' + $img[0].naturalWidth + ' x ' + $img[0].naturalHeight + ')';
19
+        get_title: function ($img) {
20
+            return $img.width() +
21
+                ' x ' + $img.height() + ' (' + $img[0].naturalWidth +
22
+                ' x ' + $img[0].naturalHeight + ')';
21 23
         },
22
-        show_tooltip: function($img) {
24
+        show_tooltip: function ($img) {
23 25
             $img.tooltip({
24 26
                 title: this.get_title($img),
25 27
                 trigger: 'manual',
26
-                container: 'body'
28
+                container: 'body',
27 29
             }).tooltip('show');
28 30
         },
29
-        hide_tooltip: function($img) {
31
+        hide_tooltip: function ($img) {
30 32
             $img.tooltip('destroy');
31
-        }
33
+        },
32 34
     });
33 35
 
34 36
     var tooltip_manager = new TooltipManager();
35 37
 
36 38
     return {
37 39
         tooltip_manager: tooltip_manager,
38
-        TooltipManager: TooltipManager
40
+        TooltipManager: TooltipManager,
39 41
     };
40 42
 });

Loading…
Cancel
Save