-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List item menu #1929
Open
thibaultzanini
wants to merge
78
commits into
montagejs:master
Choose a base branch
from
thibaultzanini:list-item-menu
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
List item menu #1929
Changes from all commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
8ba6a6d
Initial commit for ListItemMenu Component.
thibaultzanini cc56061
Add ListItemMenu .info
thibaultzanini 103edd4
Fix an issue when sliding left and right.
thibaultzanini 0a01b5c
Can swipe for opening ListItemMenu
thibaultzanini a6f0ac4
Close an opened ListItemMenu after an user click
thibaultzanini f6cb50e
Fix an issue when sliding an opened ListItemMenu
thibaultzanini 2ec8c1d
Auto open ListItemMenu when min distance is reached.
thibaultzanini 8013aaa
Improvements
thibaultzanini b2e2038
Remove console.log
thibaultzanini 51d2712
Fix wrong isOpened value
thibaultzanini f9c5965
Add Math.sign Polyfill
thibaultzanini 5491411
Center text button
thibaultzanini 140a5fe
Cleaning up
9cee95f
Fix animation glitch and improvements.
thibaultzanini e04fdd8
Improve list item menu demo
thibaultzanini 800752f
Avoid to have conflict between active items
thibaultzanini f3e9b44
Better verification
thibaultzanini 2e1472f
Cancel swipe/translate if not options are shown.
thibaultzanini beb143b
Fix typo
thibaultzanini d863922
Fix a visual glitch with the button label.
thibaultzanini 8c4cfce
Better computation of the distance
thibaultzanini 87d8f34
Support multiple buttons
thibaultzanini ecf538f
Add more list item menu sample
thibaultzanini 81f6c30
Css improvements
thibaultzanini e7e090a
Fix visual glitch with the more button.
thibaultzanini 600b291
Better Swipe detection
thibaultzanini 1d2c9e8
Add some css hooks for the list item menu
thibaultzanini 5bb189c
Add more example of the list item menu.
thibaultzanini fafe288
Raise an Action event when the edge of a side has been reached.
thibaultzanini 44c7628
Fix visual glitch
thibaultzanini bf222e3
Add an animation when side reached the end and improvements
thibaultzanini 17ac9b9
Css clean up
thibaultzanini d7bc7de
Change animation
thibaultzanini 6914464
Preparatory work for better elastic effect
thibaultzanini 990631f
Workaround in order to animate the label of a button
thibaultzanini ef1ff14
Make smoother the elastic effect
thibaultzanini f8e1bac
Fix visual glich
thibaultzanini 5124787
Cleaning up and Optimisation.
thibaultzanini 9a8e457
Cleaning up and performance optimisation of the draw function
thibaultzanini 842affd
fix lint
thibaultzanini c66bcd3
css improvements
thibaultzanini d9f200e
Add default list item component to the list item menu component
thibaultzanini b446c8e
Update list item menu sample
thibaultzanini ea6001f
Unlod/load the press-composer of the repetition when it's needed
thibaultzanini 6f94de7
Update list item menu sample css.
thibaultzanini 293505c
Make the list item menu working within a repetition
thibaultzanini 64b09e2
Add default delete button to the list item menu
thibaultzanini 018dc65
Make the list working with the list item menu
thibaultzanini ee670e4
Set the property targetElement when the translate composer dispatches…
thibaultzanini 2abc5da
Make the list item menu compatible with the cascading list.
thibaultzanini 20ed119
remove debugger statement
thibaultzanini c4fcc78
Refactor List Item menu logic
thibaultzanini 59e0291
Fix glitches with the list item menu
thibaultzanini 736f9d5
Cleaning up
thibaultzanini 8229a12
Preparatory works for folding/unfloding an item when hovering it.
thibaultzanini 96eefdc
Allow to fold the 2 sides of a list item menu.
thibaultzanini 3e334b5
Cleaning up
thibaultzanini c7c3357
Sneak options when folding a list item menu
thibaultzanini daf55a9
Improvements
thibaultzanini 7eb0b7c
Code clean up and document list item properties
thibaultzanini 37ba727
Make sure the list item menu compute again its boundaries after resizing
thibaultzanini c9cb0e7
Only fold list item menu when the pointer is a mouse
thibaultzanini 66382ee
Fix jshint warnings
thibaultzanini f91a3ad
Fix regression.
thibaultzanini c9b9999
Fix an issue when resizing
thibaultzanini 1d58536
Refactor List Item Menu
thibaultzanini 13a3654
Remove console logs
thibaultzanini e6bd3fb
Fix wrong distance logic
thibaultzanini 73e6856
Fix wrong openedSide value
thibaultzanini 0f31829
Fix open method
thibaultzanini 9649af7
Make isTranslating property public
thibaultzanini 01dc409
Rearrange code and cleaning up.
thibaultzanini 0262457
Fix jshint warning
thibaultzanini f05b5b3
Can tweak min and max distance for automatically open/close a list it…
thibaultzanini 8752882
Fix bad position for the hot corners
thibaultzanini 2777b3e
Update the font awesome version dependency of some .info sample.
thibaultzanini 0fabee7
performance improvements
thibaultzanini 38196ee
Update the list item menu
thibaultzanini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
if (!Math.sign) { | ||
/** | ||
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign | ||
*/ | ||
Math.sign = function (x) { | ||
return ((x > 0) - (x < 0)) || +x; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
test/mocks/data/models/employee-list-item-menu-ui-descriptor.mjson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"root": { | ||
"prototype": "core/meta/user-interface-descriptor", | ||
"values": { | ||
"listItemMenuDeleteNameExpression": "'Delete'" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<title>List Item Menu Sample</title> | ||
<link href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" rel="stylesheet"> | ||
<script src="../../../montage.js" async></script> | ||
<script type="text/montage-serialization"> | ||
{ | ||
"owner": { | ||
"prototype": "montage/ui/loader.reel" | ||
} | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "list-item-menu-sample", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"montage": "*" | ||
}, | ||
"mappings": { | ||
"montage": "../../../" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
html, body, .Main { | ||
padding: 0; | ||
margin: 0; | ||
height: 100%; | ||
font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
-webkit-user-select: none; | ||
-khtml-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
} | ||
|
||
.Main { | ||
padding: 20px; | ||
} | ||
|
||
header { | ||
margin: 60px 0; | ||
font-size: 2rem; | ||
text-align: center; | ||
color: #33495d; | ||
height: 40px; | ||
} | ||
|
||
.items { | ||
margin: auto; | ||
height: 500px; | ||
width: 300px; | ||
} | ||
|
||
.ListItemMenu.gray .ListItemMenu-options button { | ||
font-size: 14px; | ||
white-space: nowrap; | ||
color: rgb(100, 100, 100); | ||
} | ||
|
||
.ListItemMenu.gray .ListItemMenu-options button .dot { | ||
background-color: rgb(100, 100, 100); | ||
} | ||
|
||
.ListItemMenu.gray.is-opened.right-side .ListItemMenu-content { | ||
border-right: 1px solid #bdc3c7; | ||
} | ||
|
||
.ListItemMenu.gray.is-opened.left-side .ListItemMenu-content { | ||
border-left: 1px solid #bdc3c7; | ||
} | ||
|
||
.ListItemMenu .archive { | ||
background-color: #2C82C9; | ||
} | ||
|
||
.ListItemMenu .delete { | ||
background-color: #e74c3c; | ||
} | ||
|
||
.ListItemMenu .more { | ||
background-color: #9E9D9B; | ||
} | ||
|
||
.ListItemMenu .dot { | ||
height: 5px; | ||
width: 5px; | ||
background-color: white; | ||
border-radius: 50%; | ||
display: inline-block; | ||
} | ||
|
||
.ListItemMenu .move { | ||
background-color: #5659C9; | ||
} | ||
|
||
.ListItemMenu .pin { | ||
background-color: #2CC990; | ||
} | ||
|
||
.ListItemMenu[data-montage-id='list-item-menu-8'] .ListItemMenu-content { | ||
padding-left: 16px; | ||
padding-right: 16px; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to workaround the fact that today the target is the translate composer itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes