Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
refactor(macModal): Removed mac-modal-content attribute and switched …
Browse files Browse the repository at this point in the history
…to use mac-modal-data

BREAKING CHANGE
mac-modal-content is completely removed and should switch to use mac-modal-data instead
  • Loading branch information
adrianlee44 committed Nov 25, 2013

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent bfa9b37 commit 0f604bd
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/directives/modal.coffee
Original file line number Diff line number Diff line change
@@ -51,8 +51,8 @@ angular.module("Mac").directive("macModal", [
# @name mac-modal (attribute)
# @description
# Modal attribute directive to trigger modal dialog
# @param {String} mac-modal Modal ID to trigger
# @param {Object} mac-modal-data Extra data to pass along
# @param {String} mac-modal Modal ID to trigger
# @param {Expr} mac-modal-data Extra data to pass along
#
directive "macModal", [
"$parse"
@@ -67,10 +67,9 @@ directive "macModal", [
modalScope = $parse(attrs.macModalScope)($scope)
modalScope = $scope unless modalScope? and modalScope.$new?

# Deprecating mac-modal-content. Use mac-modal-data instead
dataVar = attrs.macModalContent or attrs.macModalData
data = $parse(attrs.macModalData)($scope) or {}
modal.show attrs.macModal,
data: $parse(dataVar) $scope
data: data
scope: modalScope
modalScope.$apply()
return
6 changes: 3 additions & 3 deletions src/index.jade
Original file line number Diff line number Diff line change
@@ -89,16 +89,16 @@ block append content
.modal-content(ng-controller="modalController")
h1 Just another modal
button.btn(
mac-modal = "test-modal"
mac-modal-content = "macGyverSeasonOne"
mac-modal = "test-modal"
mac-modal-data = "macGyverSeasonOne"
) Show Modal
pre.prettyprint.linenums(ng-non-bindable)
= '<mac-modal id="test-modal" mac-modal-keyboard>\n'
= ' <div ng-controller="modalController" class="modal-content">\n'
= ' <h1>Just another modal</h1>\n'
= ' </div>\n'
= '</mac-modal>\n'
= '<button mac-modal="test-modal" mac-modal-content="maGyverSeasonOne" class="btn">Show Modal</button>\n'
= '<button mac-modal="test-modal" mac-modal-data="maGyverSeasonOne" class="btn">Show Modal</button>\n'

section#scrollspy(mac-scroll-spy-anchor)
@@include("docs/html/services/scroll_spy.html")

0 comments on commit 0f604bd

Please sign in to comment.