deathau / cm-show-whitespace-obsidian

A plugin for [Obsidian](https://obsidian.md) which shows whitespace in the editor.
53 stars 6 forks source link

Use the official API method for disabling settings #13

Open jjspace opened 3 years ago

jjspace commented 3 years ago

Back when I added settings for specific whitespace characters there was not an official way to disable settings so I used this css hack and created a request on their API github https://github.com/obsidianmd/obsidian-api/issues/8

  .plugin-cm-show-whitespace-disabled {
    opacity: 0.6;

    .checkbox-container {
      cursor: not-allowed;
      // this is *not* an adequate way to disable an input but it's all we can do right now
      pointer-events: none;
    }
  }

There is now an official way in the API to disable a setting using setDisabled on both Setting and Component level. This section should be updated to use the new method.