Просмотр исходного кода

chore: use data- prefix for more intention revealing names

data- is a common prefix for indicating an attribute's content is used
to store data for the html app
Gabriel Horner 2 лет назад
Родитель
Сommit
316759eab3

+ 2 - 2
src/main/frontend/components/content.cljs

@@ -391,8 +391,8 @@
                       (let [target (gobj/get e "target")
                             block-el (.closest target ".bullet-container[blockid]")
                             block-id (some-> block-el (.getAttribute "blockid"))
-                            property-id (some-> target (.getAttribute "propertyid"))
-                            property-block-id (some-> target (.getAttribute "blockid"))
+                            property-id (some-> target (.getAttribute "data-propertyid"))
+                            property-block-id (some-> target (.getAttribute "data-blockid"))
                             {:keys [block block-ref]} (state/sub :block-ref/context)
                             {:keys [page]} (state/sub :page-title/context)]
                         (cond

+ 2 - 2
src/main/frontend/components/property.cljs

@@ -435,8 +435,8 @@
   [state block property {:keys [class-schema?]}]
   (let [repo (state/get-current-repo)]
     [:a
-     {:propertyid (:block/uuid property)
-      :blockid (:block/uuid block)
+     {:data-propertyid (:block/uuid property)
+      :data-blockid (:block/uuid block)
       :data-class-schema (boolean class-schema?)
       :title (str "Configure property: " (:block/original-name property))
       :on-click (fn []