2
0
白石誠 5 жил өмнө
parent
commit
2438352ba3

+ 38 - 0
src/client/js/components/PageHotkeys/PageEdit.jsx

@@ -0,0 +1,38 @@
+import React from 'react';
+
+/**
+ *
+ * @export
+ * @extends {React.Component}
+ */
+
+export default class PageEdit extends React.Component {
+
+  // when this is called it returns the hotkey stroke
+  static getHotkeyStroke() {
+    return ['e'];
+  }
+
+  static getComponent() {
+    return <PageEdit />;
+  }
+
+  componentDidMount() {
+    // ignore when dom that has 'modal in' classes exists
+    if (document.getElementsByClassName('modal in').length > 0) {
+      return;
+    }
+    // show editor
+    $('a[data-toggle="tab"][href="#edit"]').tab('show');
+    event.preventDefault();
+    return null;
+  }
+
+  render() {
+    return (
+      <React.Fragment>
+      </React.Fragment>
+    );
+  }
+
+}