Commit 338ae558 authored by Lingnan Wu's avatar Lingnan Wu

Change the add and edit pop up iframe to an iframe show and disapear at the...

Change the add and edit pop up iframe to an iframe show and disapear at the end of all slides.no more pop up frames
parent 60aec7c8
......@@ -53,6 +53,7 @@ Click on the top left corner of a slide to modify it or on the top right corner
<div id="add_slide">
<section id="add_slide_button"> Add Slide </section>
</div>
<div id="tools_content"></div>
<div id="dialog_add_slide" class="slide_dialog"></div>
<div id="dialog_edit_slide" class="slide_dialog"></div>
</div>
......
......@@ -141,6 +141,10 @@
<button class="bt-med dialog_submit_button" type="submit" name="Base_callDialogMethod:method" id="dialog_submit_button" accesskey="V">
<span>Add a new Slide</span>
</button>
<button class="bt-med dialog_submit_button" type="button" id="dialog_cancel_button" onclick="var iframe=window.parent.document.getElementById('iframe_add_slide');
iframe.parentNode.removeChild(iframe);">
<span>Close</span>
</button>
</div>
</div>
</form>
......
......@@ -147,6 +147,10 @@
<button class="bt-med dialog_submit_button" type="submit" name="Base_callDialogMethod:method" id="dialog_submit_button" accesskey="V">
<span>Edit Slide</span>
</button>
<button class="bt-med dialog_submit_button" type="button" id="dialog_cancel_button" onclick="var iframe=window.parent.document.getElementById('iframe_edit_slide');
iframe.parentNode.removeChild(iframe);">
<span>Close</span>
</button>
</div>
</div>
</form>
......
......@@ -38,7 +38,8 @@ function removeClick(trigger){
//Edit a slide
function editClick(trigger){
slideNumber = parseInt($(trigger).attr('id').split('_')[2]);
$dialogEdit.dialog('open');
$("#tools_content").append(editSlideIframe);
//$dialogEdit.dialog('open');
return false;
}
......@@ -301,6 +302,8 @@ $(document).ready(function(){
addSlideIframe = $("<iframe>");
addSlideIframe.attr('id','iframe_add_slide');
addSlideIframe.attr('src','/lib/presentation/TestPage_viewSlideCreator');
addSlideIframe.attr('width','700xp');
addSlideIframe.attr('height','365xp');
addSlideIframe.load(function() {
function initFrame(){
......@@ -361,7 +364,7 @@ $(document).ready(function(){
setTimeout(initFrame, 0);
});
var $dialog = $("#dialog_add_slide")
/* var $dialog = $("#dialog_add_slide")
.dialog({
title: "Add new slide",
autoOpen: false,
......@@ -376,9 +379,10 @@ $(document).ready(function(){
position: 'center'
});
$dialog.append(addSlideIframe);
$dialog.append(addSlideIframe);*/
$('#add_slide_button').click(function() {
$dialog.dialog('open');
//$dialog.dialog('open');
$("#tools_content").append(addSlideIframe);
return false;
});
......@@ -386,6 +390,8 @@ $(document).ready(function(){
editSlideIframe = $("<iframe>");
editSlideIframe.attr('id','iframe_edit_slide');
editSlideIframe.attr('src','lib/presentation/TestPage_viewSlideEditor');
editSlideIframe.attr('width','700xp');
editSlideIframe.attr('height','365xp');
editSlideIframe.load(function() {
function initFrame(){
......@@ -486,13 +492,16 @@ $(document).ready(function(){
}
}
appendSection();
//close the iframe after editing.
var iframe=window.parent.document.getElementById('iframe_edit_slide');
iframe.parentNode.removeChild(iframe);
});
}
setTimeout(initFrame, 0);
});
$dialogEdit = $("#dialog_edit_slide")
/* $dialogEdit = $("#dialog_edit_slide")
.dialog({
title: "Edit slide",
autoOpen: false,
......@@ -505,9 +514,9 @@ $(document).ready(function(){
width: "50%",
height: "auto",
position: 'center'
});
});*/
$dialogEdit.append(editSlideIframe);
// $dialogEdit.append(editSlideIframe);
$('.edit_slide_button').click(function() {
editClick(this);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment