Skip to content

Commit

Permalink
Module support text type
Browse files Browse the repository at this point in the history
  • Loading branch information
aNd1coder committed Mar 11, 2016
1 parent 00a26b6 commit b7335aa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ app.locals.MODULETYPE = {
bundle: '商品包',
hota: '热点图',
banner: '通栏图',
text: '文字块',
slider: '轮播图'
};

Expand Down
44 changes: 24 additions & 20 deletions views/page/_modal.jade
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,32 @@ script#tpl-page-module(type="text/html").
var background = (module[4] ? 'background-color:' + module[4] : '') + (module[5] ? 'background-image:url(' + module[5] + ')' : '');
var style = background ? ' style="' + background + '"' : '';

if(content){ %>
<a name="<%= index %>" title="<%= module[0] %>"></a>
<% if (type == 'bundle') { %>
<div id="<%= index %>" class="<%= klass %> module-theme-<%= module[3] || 1 %>" data-id="<%= content %>"<%= style %>>
<i class="loading"></i>
</div>
<% }
if(content){ %>
<a name="<%= index %>" title="<%= module[0] %>"></a>
<% if (type == 'bundle') { %>
<div id="<%= index %>" class="<%= klass %> module-theme-<%= module[3] || 1 %>" data-id="<%= content %>"<%= style %>>
<i class="loading"></i>
</div>
<% }

if (type == 'slider') { %>
<div id="<%= index %>" class="<%= klass %>" data-id="<%= content %>"<%= style %>>
<i class="loading"></i>
</div>
<% }
if (type == 'hota') { %>
<div id="<%= index %>" class="<%= klass %>"<%= style %>>
<div class="container"><%= content.replace('class="hota-imgholder" src','class="hota-imgholder" src="#{setting.imgholder}" data-src') %></div>
</div>
<% }

if (type == 'hota') { %>
<div id="<%= index %>" class="<%= klass %>"<%= style %>>
<div class="container"><%= content.replace('class="hota-imgholder" src','class="hota-imgholder" src="#{setting.imgholder}" data-src') %></div>
</div>
<% }
if (type == 'banner') { %>
<div id="<%= index %>" class="<%= klass %>" data-src="<%= content %>"></div>
<% }

if (type == 'banner') { %>
<div id="<%= index %>" class="<%= klass %>" data-src="<%= content %>"></div>
<% }
if (type == 'text') { %>
<div id="<%= index %>" class="<%= klass %>"><div class="container"><%= content %></div></div>
<% }

if (type == 'slider') { %>
<div id="<%= index %>" class="<%= klass %>" data-id="<%= content %>"<%= style %>>
<i class="loading"></i>
</div>
<% }
}
}%>

0 comments on commit b7335aa

Please sign in to comment.