Simple create session which uses api. Only description field is recognized. No response handler.
This commit is contained in:
parent
5599aa9405
commit
90a6996bd8
|
|
@ -36,6 +36,24 @@
|
|||
$('.homecard').on('mouseleave', function() {
|
||||
$(this).removeClass('hover');
|
||||
});
|
||||
$('#btn-create-session').on('click', function() {
|
||||
createSession();
|
||||
});
|
||||
}
|
||||
|
||||
function createSession() {
|
||||
var url = "/api/sessions";
|
||||
var description = $.trim($('#create-session-description').val());
|
||||
var data = {
|
||||
description: description
|
||||
};
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: data
|
||||
}).done(function( msg ) {
|
||||
alert( "Data Saved: " + JSON.stringify(msg) );
|
||||
});
|
||||
}
|
||||
|
||||
this.initialize = function() {
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@
|
|||
|
||||
<div class="formrow">
|
||||
<label>Session Description</label>
|
||||
<textarea></textarea>
|
||||
<textarea id="create-session-description"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="formrow">
|
||||
|
|
@ -230,7 +230,7 @@
|
|||
</fieldset>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<button layout-link="session">Join Session</button>
|
||||
<button layout-link="session" id="btn-create-session">Create Session</button>
|
||||
<button layout-link="home">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -373,7 +373,6 @@
|
|||
<!-- Find Session Screen -->
|
||||
<div layout="screen" layout-id="findSession" class="screen secondary">
|
||||
<h1>Find a Session</h1>
|
||||
<p>TODO</p>
|
||||
<p layout-link="home">Home</p>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue