The cancel button now works (thanks, Sam). On to the server side.

To implement active->emeritus we need to update members.txt and move the 
request file from emeritus-requests-received to emeritus. 

- Is there an svn function to move a file from one directory to another?
- Is there a way to have both things done in the same svn commit? 

To implement request_emeritus_status we need to create an email. Easy..

To implement rescind_emeritus_request we need to svn rm the file from 
emeritus-requests-received. 

- Is there an svn function to delete a file?

Thanks,
Craig

> On May 26, 2020, at 3:20 PM, Craig Russell <apache....@gmail.com> wrote:
> 
> Here are the files.
> <main.js.rb><memstat.js.rb>
> And the console logs:
> [Log]  dblclick event.currentTarget: [object HTMLDivElement] (app.js, line 
> 3268)
> [Log]  dblclick event.currentTarget.dataset: [object DOMStringMap] (app.js, 
> line 3269)
> [Log]  dblclick event.currentTarget.dataset.edit: memstat (app.js, line 3270)
> [Log] canx called from Cancel button (app.js, line 4021)
> [Log] event: [object MouseEvent] parent: [object HTMLButtonElement] (app.js, 
> line 4024)
> [Log] parent: [object HTMLButtonElement] memstatElement: [object 
> HTMLDivElement] (app.js, line 4025)
> [Log] preventing default (app.js, line 4026)
> [Log] memstatElement.dataset: [object DOMStringMap] (app.js, line 4027)
> [Log] memstatElement.dataset.edit: memstat (app.js, line 4028)
> [Log]  submit event: [object Object] (app.js, line 3291)
> [Log]  submit target: [object HTMLButtonElement] (app.js, line 3292)
> [Log]  submit parent: [object HTMLButtonElement] (app.js, line 3293)
> [Log]  submit parent.getAttribute(data_cancel): null (app.js, line 3294)
> [Log]  submit target.dataset_edit: undefined (app.js, line 3295)
> [Log]  submit target.dataset: [object DOMStringMap] (app.js, line 3296)
> [Log]  submit target.dataset.edit: undefined (app.js, line 3297)
> [Log]  submit memstatElement.dataset.edit: memstat (app.js, line 3298)
> [Log]  submit cancel_submit: null (app.js, line 3300)
> 
>> On May 26, 2020, at 2:19 PM, Sam Ruby <ru...@intertwingly.net> wrote:
>> 
>> On Tue, May 26, 2020 at 1:32 AM Craig Russell <apache....@gmail.com> wrote:
>>> 
>>> But calling preventDefault on the event doesn't appear to do anything. It 
>>> still calls the POST behavior, and does not cause the inline edit menu to 
>>> disappear. And setting the edit function to nil doesn't do anything either.
>>> 
>>> Maybe there is something else that I need to do?
>> 
>> I'll admit that I'm not clear on what you are trying to accomplish,
>> but apparently the problem here is that there is another piece of code
>> that attaches an event handler (and calls preventDefault):
>> 
>> https://github.com/apache/whimsy/blob/d3246f107a35f4d989350f4c1ca64366c98ef423/www/roster/views/person/main.js.rb#L341
>> 
>> Perhaps it would be best to add an attribute to the button, and have
>> the submit method remove the buttons and exit early:
>> 
>> diff --git a/www/roster/views/person/main.js.rb
>> b/www/roster/views/person/main.js.rb
>> index 1b5ffdb8..f498489f 100644
>> --- a/www/roster/views/person/main.js.rb
>> +++ b/www/roster/views/person/main.js.rb
>> @@ -355,6 +355,12 @@ class Person < Vue
>>    form = jQuery(event.currentTarget).closest('form')
>>    target = event.target
>> 
>> +    # if button is a cancel button, don't submit and remove buttons
>> +    if target.getAttribute('data-cancel')
>> +      @edit = null
>> +      return
>> +    end
>> +
>>    # serialize form
>>    formData = form.serializeArray();
>> 
>> diff --git a/www/roster/views/person/memstat.js.rb
>> b/www/roster/views/person/memstat.js.rb
>> index 39367c40..e8d3d318 100644
>> --- a/www/roster/views/person/memstat.js.rb
>> +++ b/www/roster/views/person/memstat.js.rb
>> @@ -35,6 +35,8 @@ class PersonMemberStatus < Vue
>>               _button.btn.btn_primary 'move to emeritus',
>>                 name: 'action', value: 'emeritus'
>>             end
>> +
>> +              _button.btn.btn_secondary 'cancel', data_cancel: true
>>           end
>>         end
>>        end
>> 
>> - Sam Ruby
> 
> Craig L Russell
> c...@apache.org
> 

Craig L Russell
c...@apache.org

Reply via email to