Skip to content
Browse files

minor

  • Loading branch information...
1 parent c37ca6e commit 779641c3bc45e7e5011ec6b121be5b216bf6a2da Adeel Ahmad Khan committed
Showing with 16 additions and 16 deletions.
  1. +16 −16 src/froelich/core.cljs
View
32 src/froelich/core.cljs
@@ -1,7 +1,7 @@
(ns froelich.core
- (:require goog.dom
- goog.dom.classes
- goog.dom.query))
+ (:require [goog.dom :as gdom]
+ [goog.dom.classes :as gclasses]
+ [goog.dom.query :as gquery]))
;; selectors
@@ -9,13 +9,13 @@
(.getElementById js/document (name id)))
(defn get-by-class [klass container]
- (goog.dom/getElementsByClass (name klass) container))
+ (gdom/getElementsByClass (name klass) container))
(defn get [tag klass container]
- (goog.dom/getElementsByTagNameAndClass (name tag) (name klass) container))
+ (gdom/getElementsByTagNameAndClass (name tag) (name klass) container))
(defn query [selector container]
- (goog.dom.query selector container))
+ (gdom.query selector container))
(comment
(dom/get-by-class :child (dom/get-by-id :container))
@@ -25,35 +25,35 @@
;; related
(defn get-children [el]
- (goog.dom/getChildren el))
+ (gdom/getChildren el))
(defn get-next [el]
- (goog.dom/getNextNode el))
+ (gdom/getNextNode el))
(defn get-previous [el]
- (goog.dom/getPreviousNode el))
+ (gdom/getPreviousNode el))
;; manipulation
(defn append! [el container]
- (goog.dom/appendChild container el))
+ (gdom/appendChild container el))
(defn remove! [el]
- (goog.dom/removeNode el))
+ (gdom/removeNode el))
;; classes
(defn get-classes [el]
- (goog.dom.classes/get el))
+ (gdom.classes/get el))
(defn has-class? [el klass]
- (goog.dom/classes/has el klass))
+ (gdom/classes/has el klass))
(defn add-class! [el & classes]
- (apply (partial goog.dom.classes/add el) classes))
+ (apply (partial gdom.classes/add el) classes))
(defn remove-class! [el & classes]
- (apply (partial goog.dom.classes/remove el) classes))
+ (apply (partial gdom.classes/remove el) classes))
(defn toggle-class! [el klass]
- (goog.dom.classes/toggle el klass))
+ (gdom.classes/toggle el klass))

0 comments on commit 779641c

Please sign in to comment.
Something went wrong with that request. Please try again.