Browse Source

Adds onRemove callback to popup, adds docs for all callbacks #815

pull/4188/head
jlukic 10 years ago
parent
commit
773015d95e
4 changed files with 101 additions and 25 deletions
  1. 9
      RELEASE NOTES.md
  2. 75
      server/documents/hotfix.html.eco
  3. 40
      server/documents/modules/popup.html.eco
  4. 2
      src/modules/popup.js

9
RELEASE NOTES.md

@ -1,5 +1,14 @@
## RELEASE NOTES
### Version 0.17.0 - May 9, 2014
**Enhancements**
- **Dropdown** - Dropdowns can now recieve focus and be navigated with a keyboard
**Fixes**
- **Modal** - Element does not accurately close other modals when initialized at different times **Thanks nojhamster**
- **Modal** - Fixes javascript error for browsers that don't support CSS animations if jquery.easing is not included
### Version 0.16.1 - April 22, 2014
**Fixes**

75
server/documents/hotfix.html.eco

@ -10,37 +10,62 @@ type : 'Library'
<script type='text/javascript'>
$(document).ready(function() {
$('#modal1').modal({
allowMultiple: false,
debug: true
});
$(document).ready(function () {
var settings = {
inline : true,
on : 'blur'
};
$('#modal2').modal({
allowMultiple: false,
debug: true
});
var consultantRules = {
required : {
identifier : 'required',
rules : [{
type : 'empty',
prompt : 'Please enter value.'
}]
}
$('#modal1').modal('show');
};
$('.form').form(consultantRules, settings);
});
});
</script>
<div class="main container">
<div id="modal1" class="ui modal">
<div class="content">
<p>First content</p>
<p>bigger</p>
<p>than</p>
<p>the</p>
<p>second</p>
<p>one</p>
<p><a href="#" onclick="$('#modal2').modal('show')">Jump to second modal</a></p>
</div>
</div>
without form :
<div class="inline field">
<label class="email optional" for="landing_user_Votre email">Votre email</label>
<div class="ui input left icon">
<input id="landing_user_email" name="landing_user[email]" required="required" type="text">
<i class="icon mail outline"></i>
</div>
</div>
<br/> <br/>
with ui form and with input icon:
<form class='ui form'>
<div class="inline field">
<label class="email optional" for="landing_user_Votre email">Votre email</label>
<div class="ui input left icon">
<input id="landing_user_email" name="landing_user[email]" required="required" type="text">
<i class="icon mail outline"></i>
</div>
</div>
</form>
<br/>
<br/>
with ui form and without input icon
<form class='ui form'>
<div class="inline field">
<label class="email optional" for="landing_user_Votre email">Votre email</label>
<input id="landing_user_email" name="landing_user[email]" required="required" type="text">
<div id="modal2" class="ui modal">
<div class="content">
<p>Second content</p>
<p><a href="#" onclick="$('#modal1').modal('show')">Jump to first modal</a></p>
</div>
</div>
</form>
</div>

40
server/documents/modules/popup.html.eco

@ -376,6 +376,46 @@ type : 'UI Module'
</tbody>
</table>
<div class="ui horizontal section divider"><i class="icon setting"></i></div>
<h3 class="ui header">
Callbacks
<div class="sub header">Callbacks specify a function to occur after a specific behavior.</div>
</h3>
<table class="ui celled sortable definition table segment">
<thead>
<tr>
<th class="four wide">Setting</th>
<th>Context</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>onCreate</td>
<td>Popup</td>
<td>Is called after a popup is created</td>
</tr>
<tr>
<td>onRemove</td>
<td>Popup</td>
<td>Is called after a popup is removed from the page</td>
</tr>
<tr>
<td>onShow</td>
<td>Element</td>
<td>Is called after a popup is shown.</td>
</tr>
<tr>
<td>onHide</td>
<td>Element</td>
<td>Is called after a popup is hidden.</td>
</tr>
</tbody>
</table>
<h3 class="ui header">
Content Settings
<div class="sub header">Settings to specify popup contents</div>

2
src/modules/popup.js

@ -259,6 +259,7 @@ $.fn.popup = function(parameters) {
$popup
.remove()
;
$.proxy(settings.onRemove, $popup)();
},
save: {
@ -786,6 +787,7 @@ $.fn.popup.settings = {
namespace : 'popup',
onCreate : function(){},
onRemove : function(){},
onShow : function(){},
onHide : function(){},

Loading…
Cancel
Save