浏览代码

fix initial render of disabled items in popup

Gerald 9 年之前
父节点
当前提交
4fa575a8d4
共有 3 个文件被更改,包括 8 次插入8 次删除
  1. 1 1
      README.md
  2. 6 6
      scripts/i18n.js
  3. 1 1
      src/popup/app.js

+ 1 - 1
README.md

@@ -2,7 +2,7 @@ Violentmonkey
 =============
 
 Violentmonkey provides userscripts support for Chromium-based Opera.  
-Violentmonkey for Opera Presto: <https://github.com/Violentmonkey/Violentmonkey-oex>
+Violentmonkey for Opera Presto: <https://github.com/violentmonkey/violentmonkey-oex>
 
 For more information, click [here](https://violentmonkey.github.io/).
 

+ 6 - 6
scripts/i18n.js

@@ -85,13 +85,13 @@ Locales.prototype.getLanguages = function () {
   });
 };
 Locales.prototype.load = function () {
-  return this.getLanguages().then((langs) => {
+  return this.getLanguages().then(langs => {
     this.langs = langs;
-    return Promise.all(langs.map((lang) => {
+    return Promise.all(langs.map(lang => {
       const locale = this.data[lang] = new Locale(lang, `${this.prefix}/${lang}/messages`, this.base);
       return locale.loaded;
     }));
-  }).then((data) => {
+  }).then(data => {
     const desc = data[this.langs.indexOf(this.defaultLang)];
     for (let key in desc) {
       this.desc[key] = {
@@ -176,7 +176,7 @@ function extract(options) {
 
   function endStream(cb) {
     locales.loaded.then(() => {
-      keys.forEach((key) => {
+      keys.forEach(key => {
         locales.touch(key);
       });
       return locales.dump({
@@ -185,8 +185,8 @@ function extract(options) {
         markUntouched: options.markUntouched,
         extension: options.extension,
       });
-    }).then((files) => {
-      files.forEach((file) => {
+    }).then(files => {
+      files.forEach(file => {
         this.push(file);
       });
       cb();

+ 1 - 1
src/popup/app.js

@@ -92,7 +92,7 @@ BaseView.prototype.postrender.call(window);
           return new MenuItem({
             id: script.id,
             name: script.custom.name || _.getLocaleString(script.meta, 'name'),
-            data: script.enabled,
+            data: !!script.enabled,
             symbol: scriptSymbol,
             title: true,
             className: 'ellipsis',