左侧菜单选中效果

This commit is contained in:
Jack Zhuang 2017-12-12 19:12:03 +08:00
parent 3e23067a35
commit 7fb230bd1d
7 changed files with 13 additions and 16 deletions

View File

@ -1,7 +1,7 @@
Creator.Objects.customers =
name: "customers"
label: "Customers"
icon: "ion-ios-people-outline"
icon: "ion-ios-world-outline"
schema:
name:
label: "Name",

View File

@ -1,3 +1,3 @@
Template.recordLayout.helpers
Template.creatorLayout.helpers
subsReady: ->
return Steedos.subsBootstrap.ready()

View File

@ -1,4 +1,4 @@
<template name="recordLayout">
<template name="creatorLayout">
{{#if subsReady}}
<div class="steedos app-wrapper steedos-calendar skin-blue-light">
{{# AdminLTE skin="blue" sidebarMini="true" }}

View File

@ -2,8 +2,9 @@ Template.creatorSidebar.helpers
app_objects: ()->
return Session.get("app_objects")
is_current_object: ()->
return this == FlowRouter.getParam("object_name")
object_i: ()->
return Creator.Objects[this]
object: ()->
return Creator.Objects[this]
object_class_name: (obj)->
if (obj == FlowRouter.getParam("object_name"))
return "active"

View File

@ -6,10 +6,10 @@
Creator
</li>
{{#each app_objects}}
<li class="inbox {{#if is_current_object}}active{{/if}}">
<li class="{{object_class_name this}}">
<a href="/creator/crm/{{this}}/list">
<i class="ion {{object.icon}}"></i>
<span>{{object.label}}</span>
<i class="ion {{object_i.icon}}"></i>
<span>{{object_i.label}}</span>
<!-- <span class="pull-right-container">
<span class="label pull-right bg-red">10</span>
</span> -->

View File

@ -11,8 +11,5 @@ FlowRouter.route '/creator',
FlowRouter.route '/creator/:app_id/:object_name/list',
triggersEnter: [ checkUserSigned ],
action: (params, queryParams)->
Meteor.call "creator_object_init", params.object_name, (error, object)->
if object
Creator.objectClientInit(params.object_name, object);
BlazeLayout.render 'recordLayout',
main: "creator_list"
BlazeLayout.render 'creatorLayout',
main: "creator_list"

View File

@ -51,7 +51,6 @@ Creator.baseSchema =
Meteor.startup ->
_.each Creator.Objects, (obj, object_name)->
console.log ("init " + object_name)
if !Creator.Collections[object_name]
schema = Creator.getObjectSchema(obj)
_simpleSchema = new SimpleSchema(schema)