소스 검색

Switch all uses of dataset to (get|set|remove)Attribute.

Afshin Darian 8 년 전
부모
커밋
f735957688
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      src/application/shell.ts
  2. 1 1
      src/completer/widget.ts

+ 2 - 2
src/application/shell.ts

@@ -386,9 +386,9 @@ class SideBarHandler {
       newWidget.show();
     }
     if (newWidget) {
-      document.body.dataset[`${this._side}Area`] = newWidget.id;
+      document.body.setAttribute(`data-${this._side}Area`, newWidget.id);
     } else {
-      delete document.body.dataset[`${this._side}Area`];
+      document.body.removeAttribute(`data-${this._side}Area`);
     }
     this._refreshVisibility();
   }

+ 1 - 1
src/completer/widget.ts

@@ -588,7 +588,7 @@ namespace Private {
   function itemValues(items: NodeList): string[] {
     let values: string[] = [];
     for (let i = 0, len = items.length; i < len; i++) {
-      values.push((items[i] as HTMLElement).dataset['value']);
+      values.push((items[i] as HTMLElement).getAttribute('data-value'));
     }
     return values;
   }