couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-2574) Clicking away from editor with unsaved changes should always show "do you want to save?" msg
Date Tue, 17 Feb 2015 12:47:12 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14324141#comment-14324141
] 

ASF subversion and git services commented on COUCHDB-2574:
----------------------------------------------------------

Commit b030b218a5e9e1fd891bc9750c593f356dd5cb7f in couchdb-fauxton's branch refs/heads/master
from [~robertkowalski]
[ https://git-wip-us.apache.org/repos/asf?p=couchdb-fauxton.git;h=b030b21 ]

Fix missing confirmation when leaving editor

Fix for passing false as a string with is evaluated truthy

This fixes a bug where you edited a document and then got no
confirmation dialog if you are really sure you want to leave the
page without saving if you clicked on the navigation bar on the
left.

To not render a property in React we need to pass `null` to it. If
we are passing `false` or `"false"` it gets rendered into the DOM.

Having `data-bypass="false"` will mean to the selector
`:not(["data-bypass"])` that there is a `data-bypass` - containing
a String! (which then matches the selector)

What we want is _no_ `data-bypass` if we don't want to bypass.

Closes COUCHDB-2574


> Clicking away from editor with unsaved changes should always show "do you want to save?"
msg
> --------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-2574
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2574
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Fauxton
>            Reporter: Ben Keen
>            Assignee: Ben Keen
>
> Any time the user has made changes to the content in an Ace Editor then tries navigating
away from the page, it should confirm they don't want the information lost. We do this in
a few places right now, but not everywhere. 
> The core FauxtonAPI.navigate function checks any beforeUnload functions all pass prior
to redirecting. The issue is that in main.js, the chief event delegation function running
on all <a>'s checks for the existence of a data-bypass attribute, but not that the attribute
is set to true. 
> Once we change this:
> bq. $(document).on("click", "a:not([data-bypass])", function(evt) {
> ... to this ...
> bq. $(document).on("click", "a:not([data-bypass=true])", function(evt) {
> ... the FauxtonAPI.navigate() function will be properly called for all links that aren't
explicitly bypassing event delegation, and thus the beforeUnload function containing the alert()
will get called as we want.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message