瀏覽代碼

Merge pull request #1030 from coresh/patch-1

Fixes issue of method 'setTooltip'
j8
Дамян Минков 8 年之前
父節點
當前提交
5c6f897ce7
共有 1 個檔案被更改,包括 5 行新增3 行删除
  1. 5
    3
      modules/UI/util/UIUtil.js

+ 5
- 3
modules/UI/util/UIUtil.js 查看文件

@@ -131,10 +131,12 @@ const TOOLTIP_POSITIONS = {
131 131
      * @param position the position of the tooltip in relation to the element
132 132
      */
133 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…
取消
儲存