当前位置: 首页 > 软件库 > 程序开发 > >

ember-side-menu

Side menu component for Ember.js applications
授权协议 MIT License
开发语言 JavaScript
所属分类 程序开发
软件类型 开源软件
地区 不详
投 递 者 拓拔泉
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Ember-side-menu

Mobile friendly Ember menu component using CSS transitions. More effects and SVG path animations coming soon.

menu

Demo

Check out the live demo here

Ember Compability

This addon is compatible with and tested against Ember 2.x and higher.

Installation

ember install ember-side-menu

Import ember-side-menu styles in your application's app.scss file.

@import "ember-side-menu";

Usage

Side Menu

{{#side-menu}} component is a main container of your menu. Place it on some top level of your DOMdocument for example in application.hbs file.

{{#side-menu}}
  <header class="navbar navbar-default">
    <div class="navbar-header">
    ...
    </div>
  </header>
  <ul class="nav">
    <li class="header">Events</li>
    <li>
      {{#side-menu-link-to "new"}}
        {{inline-svg "plus" class="icon"}}
        New Event
      {{/side-menu-link-to}}
    </li>
    <li class="divider"></li>
    ...
    <li>
      <a href="https://cowbell-labs.com/" target="_blank">
        {{inline-svg "cowbell" class="icon cowbell"}}
        Cowbell Labs
      </a>
    </li>
  </ul>
{{/side-menu}}
{{content-backdrop}}
<div class="page-content">
  {{partial "shared/navbar"}}

  <main>
    <div class="container">
      {{outlet}}
    </div>
  </main>

  {{outlet "footer"}}
</div>

Parameters

  • id - (string), menu Id, use when using multiple menus, default: "default"
  • side - (string), which side of screen your menu takes. Possible values: ["left", "right"], default: "left"
  • width - (string), target width of open menu. CSS width - example values: ["40px", "40%", ...], default: null (default width set inCSS stylesheet to 70%)
  • initialTapAreaWidth - (integer, in px) - area width on left/right screen edge when menu swipe openingis initiated, default: 30
  • slightlyOpenWidth - (integer, in px) - width of slightly open menu. Menu is opened slightly on tap eventwithin initialTapAreaWidth to the edge, default: 20
  • slightlyOpenAfter - (integer, in ms) - time delay after which menu is slighlty opened if it is still closed,default: 300

Content Backdrop

If you want to add backdrop to the rest of the layout while menu opening, then just place {{content-backdrop}}component after {{#side-menu}} component.

{{#side-menu}}
...
{{/side-menu}}
{{content-backdrop}}

Parameters

  • menuId - (string), id of controlled menu, default: "default"

Side Menu Toggle

Like a button component to toggle menu.

You can use default toggle button consist with some toggle bars

{{side-menu-toggle}}

You can use your own design block.

{{#side-menu-toggle}}
  <span class="glyphicon glyphicon-menu-hamburger"></span>
{{/side-menu-toggle}}

You can create a custom one by extending the main component.

import SideMenuToggle from "ember-side-menu/components/side-menu-toggle";

export default SideMenuToggle.extend({
    tagName: "button",
    classNames: ["navbar-btn", "btn", "btn-link", "pull-left"],
});

Parameters

  • side - (string), which side of screen your menu toggle takes. Possible values: ["left", "right"], default: "left"
  • menuId - (string), id of controlled menu, default: "default"

Side Menu Link To

Works like a standard {{link-to}} helper, but also closes the menu.

{{#side-menu-link-to "new"}}
  New Event
{{/side-menu-link-to}

Parameters

  • menuId - (string), id of menu which should be closed when clicking, default: "default"

Using multiple side menus

There is a possiblity to declare more instances of side menu components, and control them separately.Default menu id is default and it could be omitted, if you want to use more than one instance of side-menuyou should not forget about setting relevant menuId for connected menu components.

{{#side-menu side="left" id="leftMenu"}}
  Left Menu
{{/side-menu}}
{{#side-menu side="right" id="rightMenu"}}
  Right Menu
{{/side-menu}}

{{side-menu-toggle menuId="leftMenu"}}
{{side-menu-toggle menuId="rightMenu"}}

{{content-backdrop menuId="leftMenu"}}
{{content-backdrop menuId="rightMenu"}}

Side Menu Service

There is an available sideMenu service to control the menu.

export default Ember.Route.extend({
  sideMenu: Ember.inject.service(),

  actions: {
    openSideMenu() {
      this.get("sideMenu").open();
    },
  },
});

Methods

  • open(menuId='default')
  • close(menuId='default')
  • toggle(menuId='default')

Properties

For backward compability there is a possiblity to control or check default menu properties directly on service object.

  • isOpen (boolean)
  • isClosed (boolean)
  • isSlightlyOpen (boolean)
  • progress (number) 0-100

When using mutliple menus or changing default menuId then menu's state is held in menus object.

For example to get isOpen property for menu with id sampleMenu we can use this.get("sideMenu.menus.sampleMenu.isOpen".

License

MIT

 相关资料
  • SIDE (Sustainable IDE) 是一个图形化的工具,旨在帮助开发人员构建可持续发展的软件。该软件将平滑演进与您的业务和基础设施需求由于使用模型,它允许非技术层面的高度抽象

  • 描述 (Description) caption-side属性确定table.s标题的元素框的位置。 可能的值 (Possible Values) top - 将标题元素框放在表格框上方。 bottom - 将标题的元素框放在表格框下方。 left - 将标题的元素框放在表格框的左侧。 right - 将标题的元素框放在表格框的右侧。 适用于 (Applies to) 所有HTML定位元素。 DO

  • Side-Menu.iOS 是带有动画效果 UI 的 iOS 侧边菜单。 要求: iOS 7+ Swift 5 Xcode 11

  • jBPM-side是由开放流程用户组发起和维护的开源工作流项目,以jBPM4为核心,进行扩展和封装的开源工作流项目,根据国内业务系统使用工作流的特点,对接口重新组织和封装,并增加了一些国内工作流项目常用的功能,例如会签、回退、并发子流程等,并且开发了基于flex的流程设计器,使得jBPM的学习和使用成本降至最低。 jBPM-side是一个基于jBPM进行扩展和封装的开源工作流项目,根据国内业务系统

  • Side Menu 是用于安卓的分类侧滑菜单。 示例代码:     ViewAnimator viewAnimator = new ViewAnimator<>(ActionBarActivity.this,                                    new ArrayList<Resourceble>(),(LinearLayout) findViewById(R.i

  • Side Menu Side menu with some categories to choose. Check this project on dribbble. Check this project on Behance. God bless Ukraine! Sample Sample & .aar file Note depends on Ozodrukh's animation uti