Closed (fixed)
Project:
Dreditor (moved)
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Oct 2011 at 12:54 UTC
Updated:
26 Sep 2012 at 07:01 UTC
Jump to comment: Most recent file

Comments
Comment #1
helmo commentedYou seem to have forgotten the actual patch...
Comment #2
attiks commentedooops
But not sure if it's working all the time :/
Comment #3
helmo commentedIn my first test it works as expected.
How about adding something like
$mark.attr('title', 'Mark as read');to this element to improve the UI.To let the user know the click had a result we could, on a successful GET, remove the
<span class="marker">updated</span>and maybe even the '**' link.Is missing a space char.
I don't think $table is still being used...
Comment #4
helmo commentedI added a Mark ALL as read option.
And fixed my own minor comments.
Removing the marker after a successful GET is still something I would like to see,
Comment #5
helmo commentedI fixed the marker removal.
I also commented out the reload call in Mark ALL, as it was happening too fast. It can only happen after all background requests have finished.
Comment #6
attiks commentedNice work, i think the reload after 'mark all' can be optional, if you really want to add it, use a timeout of a couple of seconds.
Comment #7
attiks commentedSame patch but rerolled because of offset
Comment #8
attiks commentedanother reroll
Comment #9
sunThe selectors being used and events getting attached are looking more complex to me than they need to be:
The first line of the behavior including .once() seems to be fine (I hope you copied from another behavior that affects the project issue page/table?), but the selectors within can be drastically simplified:
Just search for
.markerand attach a click event to them:I didn't test this code, but that should cut it.
Also note that I do not really feel comfortable with adding the "mark all as read" behavior, since it issues a dozen of HTTP requests against d.o, so I'd rather want to leave that out.
Comment #10
attiks commentedthis.previousSibling might fail on whitespace, so using jquery to find the link.
Comment #11
attiks commentedbetter patch, works on dashboard and other pages
Comment #12
sunThanks!
In that case, why not
.prev('a')?Which event does this try to prevent?
Comment #13
attiks commented$marker.parent().find('a'); is safer, just in case the marker is positioned elsewhere, and the speed improvement is neglectable.
return false; removed, was from previous version.
BTW tested on:
http://drupal.org/user/105002/dashboard
http://drupal.org/project/issues/user/105002
http://drupal.org/project/issues/dreditor
Comment #14
sunI'm not sure I see why it is safer -- actually, I'd say quite the contrary; by moving up to the parent node and selecting an arbitrary link within, it's not guaranteed that this link will be the link to the issue node.
Compared to that, in terms of currently common Drupal UI practices, the new/updated marker is always output after the link to the issue node. (I'm aware that the dashboard slightly diverges from that practice, but after all, it's still compatible, since the previous link before is the "X new" link to the issue node.)
Comment #15
attiks commentedswitched to prev()
Comment #16
attiks commentedpatch with some visual indications, but no idea if it's really necessary
Comment #17
helmo commented@attiks: thanks for working on this
@sun: I can understand your reluctance to include the "mark all as read" behavior, I'm open to suggestions for a better way.
But if it's a blocker for you the let's split that off from this patch.. .
Comment #18
attiks commented@helmo, to be honest I used 'mark all as read' only once, so better to split it into a new issue, assuming that you're using it.
Comment #19
sunThanks for reporting, reviewing, and testing!
Slightly adjusted and committed attached patch.
Comment #20
helmo commentedNice.
I'm attaching a re-roll of the mark-ALL-as-read core just for future reference. We should indeed start a new issue if there is any interest in working on this.