It turns out the jQuery documentation is incomplete:
$( '<a>' ).offset() → { top: 0, left: 0 }
$( '<a>' ).parent().offset() → undefined
The difference is that the jQuery set in the second example is
empty.
Bug: T282067
Change-Id: I7c19162f1a39bd529e0a74a6cc0c1ac987f33657
… and replace them with more trivial `function …() {}`. I
believe this does not make any difference. But I feel this
makes the code a little more straightforward.
The motivation for this patch is because a few other patches
change some of these function declarations, leaving a (in my
opinion) confusing mixture of styles behind.
Change-Id: Ib8928c4176a963afcf1fee1c785dd7bdc86c9706
In my PHPStorm IDE, this makes it possible to follow all methods and
properties in these classes, even these that are later defined.
Otherwise only the empty stub of each class is found.
This might be different in other IDEs.
Basically: PHPStorm does not understand the meaning of the $.extend()
syntax from jQuery without these hints.
Change-Id: I4aa76db183122f6669dc72561441f46f0056d793
This only solves part of the issue. Highlighting is applied for more
elements since they are retrieved from the DOM. The problem still exists
since highlighting depends on the RevisionList chunk on which is it applied.
To fix the issue completely highlighing should be managed somehow globally
on the global list.
Bug: T207781
Change-Id: Idda930f3d0dd64e767c68dade2ca8759bc636898
The next iterration on avoiding code duplication. I
still stuggle a bit merging these methods in a sane
way.
Change-Id: I8d95acc06da7f83a6133e55becabdf03b26a97af
- make use of toggelCSS()
- use more general jQuery selectors ro reset the line and bubble highlight
- get rid of ~= when selecting revision ids
Change-Id: I123e263bb379107a561fe8a2ffed476da9032b88
This is mainly a copy of what's done for the tag lines to set the events.
In the next steps I'll try to avoid code duplication here be extracting
common code.
Change-Id: I29df109de30c538cc206d445abff8464baf45378
The patch adds a first package of node selenium tests including
test for the user and tag filters.
The classes for user- and tag-rows were re-added to have better
access via selectors.
Change-Id: I8c53d9c923820e177d83ee900cee08e93cd3f65b
This moves the retrieval of the revisions into the method setting the
highlighting. The check for undefined did not to much since the rev
var would still remain undefined.
Change-Id: I1acf540f135af4c16fb80d633b3690473ada7833
* Uses the existing implementation of highlighting revisions from the same user
* Shows bubble next to tags in Tooltip
* When you hover on a bubble, tag row is circled, and revisions with a specific tag gets highlighted. When hovering ends, highlighting ends. But, if there is an active filter available, all previous states are restored accordingly.
* When you click on a bubble, in addition to highlighting revisions and tag row, any previous tag or user filter is removed.
Bug: T203581
Change-Id: I824a027a7f542eb7227545870553e58ec23542bb
jQuery objects behave fine when they don't contain anything. No need
to check the .length before. This is one of the essential feature of
jQuery.
I'm also simplifying some setTimeout the same way. clearTimeout will
never fail. It will ignore numbers that never represented a timeout,
or have been cleared before. Note how the property was never set back
to -1. So this code was kind of incomplete anyway. I suggest to fix it
this way around, instead of trying to set -1.
Change-Id: Ic15812ead9d93f8eb07831aeb75577df2abdff07
Completed subtasks
* Added bubble in the Tootltip
* Added border on clicking or hovering the bubble
* Highlites Bubble on hover
* When Clicked or hover on the Bubble: Highlights
revisions from the same user
* Added filter revisions.
Bug: T136105
Change-Id: I64cfef395ce1812d501980067edffe210fc99227
Approach followed:
- Include tags as an additional parameter in rvprop field to fetch revision tags
- Use API Tags to fetch available change tags for a wiki along with their display names
- At the time of fetching revision data rebuild the revision list with tags containing display names
- Display tags one in each line on the tooltip
Bug: T180429
Change-Id: Ieba8b79ed408ff50b3f7d4bcfd7b2fa8cca83278
This patch mainly reintroduces the option to click on bars and move
the pointers with it. To do this, 'ghost' pointers are introduced
to show what would happen when bars are clicked. The pointers moved
differ depending on where the user clicks on a bar. Pointers are
still not allowed to change positions, so in some cases booth pointers
move with one click. See the task description.
The patch also includes some renaming and also refactoring of the
click handling in general. Furthermore bar hover mechanics are handled
by the RevisionListView class now.
Moving both pointers is not possible when it would push one of them of
limits.
Bug: T172092, T173566
Change-Id: I32a8256f7667e03081324d54accdf03a17454faf
Currently, `this` is passed as the parameter for pageName, making it
seem like getUrl() can take in an object as the first parameter, when
it should be a string. This works right now because of a tertiary
operator that fetches what we need. To reduce confusion, we should
pass null instead.
Change-Id: Ieea30a4933f3e3fdeb8331c5c544bf1eb034e6b7
The end border for the pointer lines can not be displayed because the
bars on the biggest revisions used all the height. This patch reduces
the max height of the bars slightly and refactores the calculating method.
Bug: T163436
Change-Id: Idfa6bdb9f85221063e13f3ec16b22fcfbe6cbd9c
The latest OOjs UI update seem to fix tooltip center positioning.
Margins added manually are removed now.
Change-Id: I883a5026002fae6fbda230b407303a4f2b82914d
This patch changes the way OOjs UI tooltips are constructed.
Until now we did not use the full potential of the widget.
Some strange behaviour remains and it seems we can not use
'horizontalPosition' here. Therefore the direction is passed
down to the RevisionsListView to center the tooltip manually
and margins are set for the help and arrow tooltips.
Bug: T159428
Change-Id: I0a67340da4d94f2f6b29e507f94fc695b44b71f9
Where we know the number contains only numerals, just cast
straight to a number using '+' operator. When getting computed
css from jQuery, use more suitable position methods instead.
Change-Id: Ia58b41a4522a1ef5a1516852821573c47e8dc9c9
Added the revisions to the exception to avoid tooltips beeing
closed and opened again when clicking on a revision-bar to
load it.
Bug: T143090
Change-Id: Ib8011a52c469ad715e97c1c42e7489c5b31aa4a8
When rendering several RevisionListView items e.g. by loading and adding
more revisions each one had its own 'currentTooltip' so the elements
where not exclusive. This patch fixes that by looking for the class
objects when closing tooltips or changing wrapper highlighting.
Tooltip timeouts are still per-list but that should not affect the
behavior with multiple lists.
Bug: T143090
Change-Id: I23c61547e1a925da1c0b7e7a475ad61e6ed1b1b6
Reordering of stuff and splitting conditions seems to fix some of wiredness.
Mouseenter and Mouseleave are the better events in these cases.
Change-Id: I66d71b1d4f394199949475dc42ca085169e0584f