fix javascript errors

This commit is contained in:
Lee Lawlor 2014-08-01 22:10:21 -04:00
parent 28bc4e18e5
commit b598a83e37
5 changed files with 94 additions and 81 deletions

View File

@ -12,20 +12,25 @@
<div id="private_dialog1" class="column" > </div>
</div>
<script>
// when the document is ready
$(document).on('page:load ready', function() {
$("#devInfoLink_private").click(
function(e) {
// when the devinfo link is clicked
$("#devInfoLink_private").click(function(e) {
var element = $("#devInfo");
openDialogCenter(element);
return false;
});
$("#portletAddLink_private").click(
function(e) {
$("#addPortlets").load('/channels/<%=@channel.id %>/hidden_windows?visibility_flag=private',
function(e) {
// when the add window link is clicked
$("#portletAddLink_private").click(function(e) {
$("#addPortlets").load('/channels/<%=@channel.id %>/hidden_windows?visibility_flag=private', function(e) {
var element = $("#addPortlets");
openDialogCenter(element);
});
return false;
});
});
</script>

View File

@ -31,20 +31,25 @@
</div>
<script>
// when the document is ready
$(document).on('page:load ready', function() {
// when the devinfo link is clicked
$("#devInfoLink_public").click(function() {
var element = $("#devInfo");
openDialogCenter(element);
return false;
});
$("#portletAddLink_public").click(function()
{
$("#addPortlets").load('/channels/<%=@channel.id %>/hidden_windows?visibility_flag=public',
function() {
// when the add window link is clicked
$("#portletAddLink_public").click(function() {
$("#addPortlets").load('/channels/<%=@channel.id %>/hidden_windows?visibility_flag=public', function() {
var element = $("#addPortlets");
openDialogCenter(element);
});
return false;
});
})
});
// comment flag function

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http<%= 's' if @ssl %>://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="http<%= 's' if @ssl %>://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="<%= @map_domain %>/maps/api/js?sensor=false"></script>
<script type="text/javascript">
// when document is ready

View File

@ -1,7 +1,7 @@
<html>
<head>
<%= stylesheet_link_tag 'application' %>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<%= javascript_include_tag 'application' %>
</head>

View File

@ -1,6 +1,5 @@
<script>
$(document).on('page:load ready', function() {
$("#tabs").tabs({
ajaxOptions: {
error: function( xhr, status, index, anchor ) {
@ -11,9 +10,11 @@ $(document).on('page:load ready', function() {
}
});
//Need to turn this into an ID so it doesn't run on more than one object
$(".ioplugin").off();
$("body").on("click", ".ioplugin", function() {
// remove handler if it already exists
$(document).off('click', '.ioplugin');
// add click handler
$(document).on('click', '.ioplugin', function() {
var plugins = $(".plugin");
var addPlugin = $(this);
@ -45,8 +46,11 @@ $(document).on('page:load ready', function() {
}) ;
});
$(".ioportlet").click(
function() {
// remove handler if it already exists
$(document).off('click', '.ioportlet');
// add click handler
$(document).on('click', '.ioportlet', function() {
var addPortlet = $(this);
var ids = addPortlet.attr('id').split("-");
@ -71,7 +75,6 @@ $(document).on('page:load ready', function() {
}) ;
});
});
</script>
<div id="tabs">
<ul>