Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Check if loader is present when calling showLoader #44

Merged
merged 2 commits into from
Jun 23, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/components/buttons/buttonview.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,23 @@ module.exports = class KDButtonView extends KDView
@loader.hide()

showLoader:->

unless @loader
return warn 'KDButtonView::showLoader is called where no loader is set'

{icon, iconOnly} = @getOptions()
@setClass "loading"
@loader.show()
@hideIcon() if icon and not iconOnly

hideLoader:->

unless @loader
return warn 'KDButtonView::hideLoader is called where no loader is set'

{icon, iconOnly} = @getOptions()
@unsetClass "loading"
@loader?.hide()
@loader.hide()
@showIcon() if icon and not iconOnly

disable:-> @$().attr "disabled", yes
Expand Down