You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2016/08/06 16:29:36 UTC
[whimsy] branch master updated: cleanup
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 9b00246 cleanup
9b00246 is described below
commit 9b0024684b6939f5ff0c887e5ee9b2a40eb33e55
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sat Aug 6 12:27:23 2016 -0400
cleanup
---
www/roster/views/group.js.rb | 14 ++++++++++----
www/roster/views/pmc/confirm.js.rb | 10 ++++++++--
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/www/roster/views/group.js.rb b/www/roster/views/group.js.rb
index 1131a12..fb1fff6 100644
--- a/www/roster/views/group.js.rb
+++ b/www/roster/views/group.js.rb
@@ -82,7 +82,7 @@ class Group < React
# update group from conformation form
def update(group)
# remove members of the group from pending lists
- for id in group
+ for id in group.members
@pending.delete(id)
end
@@ -140,7 +140,7 @@ class GroupMember < React
# automatically close row when id changes
def componentWillReceiveProps(newprops)
- @state = :closed if newprops.id != @@id
+ @state = :closed if newprops.id != self.props.id
end
# toggle display of buttons
@@ -160,6 +160,7 @@ class GroupConfirm < React
@text = 'text'
@color = 'btn-default'
@button = 'OK'
+ @disabled = false
end
def render
@@ -180,8 +181,10 @@ class GroupConfirm < React
end
_div.modal_footer do
- _button.btn.btn_default 'Cancel', data_dismiss: 'modal'
- _button.btn @button, class: @color, onClick: self.post
+ _button.btn.btn_default 'Cancel', data_dismiss: 'modal',
+ disabled: @disabled
+ _button.btn @button, class: @color, onClick: self.post,
+ disabled: @disabled
end
end
end
@@ -208,6 +211,7 @@ class GroupConfirm < React
body: {group: @@group, id: @id, action: @action}.inspect
}
+ @disabled = true
fetch('actions/authgroup', args).then {|response|
content_type = response.headers.get('content-type') || ''
if response.status == 200 and content_type.include? 'json'
@@ -218,9 +222,11 @@ class GroupConfirm < React
alert "#{response.status} #{response.statusText}"
end
jQuery('#confirm').modal(:hide)
+ @disabled = false
}.catch {|error|
alert errror
jQuery('#confirm').modal(:hide)
+ @disabled = false
}
end
end
diff --git a/www/roster/views/pmc/confirm.js.rb b/www/roster/views/pmc/confirm.js.rb
index cc78da3..0ed2494 100644
--- a/www/roster/views/pmc/confirm.js.rb
+++ b/www/roster/views/pmc/confirm.js.rb
@@ -7,6 +7,7 @@ class PMCConfirm < React
@text = 'text'
@color = 'btn-default'
@button = 'OK'
+ @disabled = false
end
def render
@@ -23,8 +24,10 @@ class PMCConfirm < React
end
_div.modal_footer do
- _button.btn.btn_default 'Cancel', data_dismiss: 'modal'
- _button.btn @button, class: @color, onClick: self.post
+ _button.btn.btn_default 'Cancel', data_dismiss: 'modal',
+ disabled: @disabled
+ _button.btn @button, class: @color, onClick: self.post,
+ disabled: @disabled
end
end
end
@@ -55,6 +58,7 @@ class PMCConfirm < React
body: {pmc: @@pmc, id: @id, action: action, targets: targets}.inspect
}
+ @disabled = true
fetch('actions/committee', args).then {|response|
content_type = response.headers.get('content-type') || ''
if response.status == 200 and content_type.include? 'json'
@@ -65,9 +69,11 @@ class PMCConfirm < React
alert "#{response.status} #{response.statusText}"
end
jQuery('#confirm').modal(:hide)
+ @disabled = false
}.catch {|error|
alert errror
jQuery('#confirm').modal(:hide)
+ @disabled = false
}
end
end
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].