kind of got the modals working - Ben will finish this

This commit is contained in:
Quincy Larson
2015-08-22 12:10:08 -07:00
parent cd4823de76
commit 73eb6ec2d1
4 changed files with 8 additions and 63 deletions

View File

@@ -59,44 +59,11 @@ $(document).ready(function() {
function reBindModals(){
$('#i-want-help').unbind('click');
$('#i-want-help').on('click', function() {
$('#help-modal').modal('hide');
var editorValue = editor.getValue();
var currentLocation = window.location.href;
$.post(
'/get-help',
{
payload: {
code: editorValue,
challenge: currentLocation
}
},
function(res) {
if (res) {
window.open('https://gitter.im/FreeCodeCamp/Help', '_blank')
}
}
);
});
$('#i-want-help-editorless').unbind('click');
$('#i-want-help-editorless').on('click', function() {
$('#help-editorless-modal').modal('hide');
var currentLocation = window.location.href;
$.post(
'/get-help',
{
payload: {
challenge: currentLocation
}
},
function(res) {
if (res) {
window.open('https://gitter.im/FreeCodeCamp/Help', '_blank')
}
}
);
$('.close-modal').unbind('click');
$('.close-modal').on('click', function(){
setTimeout(function() {
$('#issue-modal').modal('hide');
}, 2000);
});
$('#report-issue').unbind('click');
@@ -105,25 +72,6 @@ $(document).ready(function() {
window.open('https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge '+ window.location.href +' has an issue. Please describe how to reproduce it, and include links to screenshots if possible.', '_blank')
});
$('#i-want-help').unbind('click');
$('#i-want-to-pair').on('click', function() {
$('#pair-modal').modal('hide');
var currentLocation = window.location.href;
$.post(
'/get-pair',
{
payload: {
challenge: currentLocation
}
},
function(res) {
if (res) {
window.open('https://gitter.im/FreeCodeCamp/LetsPair', '_blank')
}
}
);
});
$('#completed-courseware').unbind('click');
$('#completed-courseware').on('click', function() {
$('#complete-courseware-dialog').modal('show');