Browse Source

Fixes issue of method 'setTooltip'

Fixes issue of method 'setTooltip' in modules/UI/util/UIUtil.js: Excluded 'Uncaught TypeError':
```
UIUtil.js:134 Uncaught TypeError: Cannot read property 'setAttribute' of null
```
j8
coresh 9 years ago
parent
commit
6bd5d6e4d5
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      modules/UI/util/UIUtil.js

+ 5
- 3
modules/UI/util/UIUtil.js View File

131
      * @param position the position of the tooltip in relation to the element
131
      * @param position the position of the tooltip in relation to the element
132
      */
132
      */
133
     setTooltip: function (element, key, position) {
133
     setTooltip: function (element, key, position) {
134
-        element.setAttribute('data-tooltip', TOOLTIP_POSITIONS[position]);
135
-        element.setAttribute('data-i18n', '[content]' + key);
134
+        if (element !== null) {
135
+            element.setAttribute('data-tooltip', TOOLTIP_POSITIONS[position]);
136
+            element.setAttribute('data-i18n', '[content]' + key);
136
 
137
 
137
-        APP.translation.translateElement($(element));
138
+            APP.translation.translateElement($(element));
139
+        }      
138
     },
140
     },
139
 
141
 
140
     /**
142
     /**

Loading…
Cancel
Save