UIMenu
UIMenu
Hey folks,
This email is to give you a little rundown of my plans, and also to
kind of document my ideas for myself to work on them, as I'm mobile
while I write this, and I'd appreciate any feedback, good or bad.
My plan with the menu plugin is to provide context menus for UI
elements. This can both be attached menus (as in attached to a
toolbar and always visible) and click menus (both left and right
click).
Menus will be built up of unordered list elements like so:
.newmenu { display: none; position: relative;}
<ul id="mycontextmenu" class="newmenu">
<li>New
<ul>
<li>Document</li>
<li>Image</li>
</ul>
</li>
<li class="menu-open">Open</li>
<li class="menu-exit">Exit</li>
</ul>
<div id="toolbar">
<span id="menu1" class="menutop">File</span>
</div>
To activate it, the object is the selected element you want to attach
the menu to:
$('#toolbar > #menu1').menu({menuname: 'mycontextmenu'});
This would then attach all the various classes such as ui-menu-node,
ui-menu-subnode, etc for the plugin to work, as well as repect at
classes attached by the user
In very messy psudocode, the process then would be something like this:
if (this.bind('click')) {
$(object.menuname).slideDown();
});
This would show the menu when the parent item is clicked.
The other option is for the menuname to be built up in JSON, like this:
var mymenu = {[
item: "New",
class: "menu-new",
function: "menuNew"]}
Maybe it would be able to support both? Anyway, I think that's enough
to get me started hopfully can have something useful by next week
sometime.
--
Tane Piper
http://digitalspaghetti.tooum.net
This email is: [ ] blogable [ x ] ask first [ ] private