-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor small annoyances with current code (#6)
* WIP * Remove trailing whitespaces messing up formatting * WIP
- Loading branch information
1 parent
21063e3
commit 9220e3f
Showing
4 changed files
with
75 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
defmodule Swish.Dialog.Transitions do | ||
@moduledoc """ | ||
Describes the available transitions for a dialog. | ||
""" | ||
|
||
defstruct [:show_content, :hide_content, :show_backdrop, :hide_backdrop] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Swish.EL do | ||
@moduledoc false | ||
|
||
def new_id(prefix, escaped \\ false) | ||
def new_id(prefix, true), do: "##{prefix}-#{System.unique_integer([:positive])}" | ||
def new_id(prefix, false), do: "#{prefix}-#{System.unique_integer([:positive])}" | ||
|
||
def get_id(el, escaped \\ false) | ||
def get_id(%{id: id}, true), do: "##{id}" | ||
def get_id(%{id: id}, false), do: "#{id}" | ||
|
||
def suffix_id(el, suffix, escaped \\ false) | ||
def suffix_id(%{id: id}, suffix, true), do: "##{id}-#{suffix}" | ||
def suffix_id(%{id: id}, suffix, false), do: "#{id}-#{suffix}" | ||
|
||
def event(name), do: "swish:#{name}" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters