views/engine2.coffee in engine2-1.0.1 vs views/engine2.coffee in engine2-1.0.2

- old
+ new

@@ -277,18 +277,18 @@ modal error: (title, msg, html) -> body = if html then msg else "<div class='alert alert-danger'>#{msg}</div>" clazz = if html then "modal-huge" else "modal-large" - @show meta: panel: (panel_template: "close_m", template_string: body, title: title, class: clazz) # message: msg, + @show meta: panel: (panel_template: "close_m", template_string: body, title: title, class: clazz, footer: true) # message: msg, confirm: (title, msg, action) -> body = "<div class='alert alert-warning'>#{msg}</div>" clazz = "modal-large" @show confirm: action, - meta: panel: (panel_template: "confirm_m", template_string: body, title: title, class: clazz) # message: msg, + meta: panel: (panel_template: "confirm_m", template_string: body, title: title, class: clazz, footer: true) # message: msg, .directive 'e2Modal', ($e2Modal) -> restrict: 'E' # replace: true # transclude: true @@ -299,11 +299,11 @@ (scope, elem, attrs) -> scope.$on attrs.name, (ev, args) -> return if ev.defaultPrevented ev.preventDefault() - panel = panel_template: attrs.panelTemplate, title: attrs.title, class: attrs.clazz + panel = panel_template: attrs.panelTemplate, title: attrs.title, class: attrs.clazz, footer: true if obody then panel.template_string = obody.outerHTML else panel.template = attrs.template action = meta: (panel: panel), scope: -> scope _.assign(action, args) modal = $e2Modal.show(action) @@ -384,15 +384,19 @@ # ev.stopPropagation() meta = scope.action.meta selection = scope.action.selection out = '' _.each scope.action.entries, (e, i) -> - out += if selection then "<tr ng-class='action.selected_class(#{i})' class='tr_hover' ng-click='action.select(#{i}, $event)'>" else "<tr>" + out += if selection then "<tr ng-class='action.selected_class(#{i})' class='tr_hover' ng-click='action.select(#{i}, $event)'>" else + row_cls = e.$row_info?.class + if row_cls then "<tr class=\"#{row_cls}\">" else "<tr>" out += "<td>" - out += "<div e2-button-set='action.meta.menus.item_menu' index='#{i}'></div>" if meta.config.show_item_menu # data='action.entries[#{i}]'></div> + out += "<div e2-button-set='action.meta.menus.item_menu' index='#{i}'></div>" if meta.config.show_item_menu out += "</td>" - # out += "<td><div e2-button-set='item_menu' index='#{i}' ng-if='action.meta.config.show_item_menu'></div></td>" - _.each meta.fields, (f) -> out += "<td>#{scope.action.list_cell(e, f) ? ''}</td>" + _.each meta.fields, (f) -> + out += if col_cls = meta.info[f].column_class then "<td class='#{col_cls}'>" else "<td>" + out += scope.action.list_cell(e, f) ? '' + out += "</td>" out += "</tr>" elem.empty() elem.append($compile(out)(scope)) unless out.length == 0 # leak ?