-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fba5379
commit 9b57aaa
Showing
2 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<div class="row"> | ||
<div class="twelve columns"> | ||
|
||
<button class="btn-secondary" type="button" id="add-context">Show Modal</button><br/><br/> | ||
|
||
<!-- Modal Example --> | ||
<div id="modal-add-context" class="hidden"> | ||
<div class="field"> | ||
<label for="subject">Problem</label> | ||
<input type="text" id="subject" name="subject" /> | ||
</div> | ||
|
||
<div class="field"> | ||
<label for="location" class="label">Location</label> | ||
<select id="location" name="location" class="dropdown"> | ||
<option value="N">North</option> | ||
<option value="S">South</option> | ||
<option value="E">East</option> | ||
<option value="W">West</option> | ||
</select> | ||
</div> | ||
|
||
<div class="field"> | ||
<label for="notes-max">Notes (maxlength)</label> | ||
<textarea id="notes-max" class="textarea" maxlength="90" name="notes-max">Line One</textarea> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<script> | ||
var modals = { | ||
'add-context': { | ||
'title': '<' + 'script' + '>window.alert()<' + '/script>', | ||
'id': 'my-id', | ||
'content': $('#modal-add-context') | ||
} | ||
}, | ||
|
||
setModal = function (opt) { | ||
opt = $.extend({ | ||
buttons: [{ | ||
text: 'Cancel', | ||
// id: 'modal-button-1', | ||
click: function(e, modal) { | ||
modal.close(); | ||
} | ||
}, { | ||
text: 'Save', | ||
// id: 'modal-button-2', | ||
click: function(e, modal) { | ||
modal.close(); | ||
}, | ||
validate: false, | ||
isDefault: true | ||
}] | ||
}, opt); | ||
|
||
$('body').modal(opt); | ||
}; | ||
|
||
$('#add-context').on('click', function () { | ||
setModal(modals[this.id]); | ||
}); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters