Open 1730wang opened 10 years ago
these are the steps for your reference:
f1-menu is a clone of Polymer core-menu component, with modifications.
Here's the doc for core-menu: http://www.polymer-project.org/docs/elements/core-elements.html#core-menu
This is eventually what we want:
To work on it, you want to break it down to smaller steps. if you are not sure how to break it down, i can help you.
All the steps are complete.The items move to the base position when clicked. The items are fully draggable. The next level of items can be viewed when an item is clicked. The buttons and the buttons functionality have been disabled as they are no longer needed. The speed of the items moving can be set as a constant speed or as a function. A lot of minor changes and fixes have also been added to the code
step 6, dragging, when the item is released, the item close to the base position should keep moving to the base position.
when you drag the item, the item always reposition itself to top right of the mouse cursor. we don't want that.
double click to expend the 2nd level menu single click to rotate the items
make the items fill only half(or certain percentage) of the circle. e.g. the percentage is set to 50%, there are 6 items, the circle will make 12 slots and fill the 6 items into slot 1 to slot 6, leaving slot 7 to slot 12 empty.
apply above feature to 2nd level items.
currently, drag event is listened on the item divs. i want you to make a big div, behind all the items, the big div contains all the items and drag event is handled on that big div so when you drag on the edge of the circle, the circle spinning speed is 1:1 (mouse moves 1px, circle moves 1px) when you drag close to the center of the circle, the circle spinning faster, say 1:5 (mouse moves 1px, circle moves 5px)
click the base position rectangle to trigger the circle-menu. click on the item to select and then hide the circle-menu. click outside of the circle-menu to hide the circle-menu.
make items moving along the circle path. currently, unfolding the menu is straight up .show(), and folding the menu, every item goes to the base position in a straight line. we want the items goes along the circle path, unfolding will be like a train coming out of a tunnel, and the previously selected item should remain at base position(if there's one selected) - in this case, the items before the selected item come out from the top tunnel, the items after the selected item come out from the bottom tunnel, at the same time. If there's none previously selected, all items come out in one direction, either top of bottom. folding will be similar to unfolding, just reverse the movements.
code clean up.
a template for your reference:
"use strict";
var f1menu = f1menu || {};
f1menu.globalVariable = null;
f1menu.someMethod = function() { console.log("f1menu.someMethod"); }
/* use prefix for id */
background-color: #e6e6e6;
}
/* use prefix for class */ .f1menu_someItem { background-color: #e6e6e6; }
We need a menu/dropdown polymer component to replace the current Selectize.js dropdown.
This is what the current Selectize.js dropdown looks like (it's used in dmx, attribute editor):
This is potentially what the new polymer dropdown will look like (there's a prototype in fmx, inport editor):