Sha256: 4762a57c18b47933357724af20241f53c996c7ec7c22c81f1cc3ccd15f20f1d7

Contents?: true

Size: 998 Bytes

Versions: 1

Compression:

Stored size: 998 Bytes

Contents

module = angular.module("mb.directives", [])

# Handles ESC key
module.directive "onEsc", ->
  EscapeCode = 27

  ($scope, $element, attrs) ->
    $element.bind "keyup", (event) ->
      return unless event.keyCode is EscapeCode
      $scope.$apply(attrs.onEsc)

module.directive "showButton", ->
  replace: true
  restrict: "E"
  scope:
    path: "@path",
    label: "@label"
  template: """
            <a class="btn btn-success" href="{{path}}">
              <i class="icon-th-list"></i>
              {{label || "Show"}}
            </a>
            """

module.directive "deleteButton", ->
  replace: true
  restrict: "E"
  template: """
            <a class="btn btn-danger">
              <i class="icon-remove-circle"></i>
              Delete
            </a>
            """

module.directive "refreshButton", ->
  replace: true
  restrict: "E"
  template: """
            <a class="btn">
              <i class="icon-refresh"></i>
              Refresh
            </a>
            """

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo_browser-0.2.5 app/assets/javascripts/app/directives.js.coffee