User:Shoodho/common.js: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
(23 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
var editlink = document.getElementById("ca-ve-edit"); |
var editlink = document.getElementById("ca-ve-edit"); |
||
function editlinkcliked(evt) { |
function editlinkcliked(evt) { |
||
//creating button and appending it to the #p-views DOM, at which it will enable the save button after the click of "edit" link |
|||
while(true) |
|||
$('#p-views').append('<input type="button" value="Confirm Modification" onclick="savecahnges()">'); |
|||
{ |
|||
//the save button is hiden from the screen by the following line of code |
|||
var element = document.getElementsByClassName('oo-ui-buttonElement-button'); |
|||
$( '#oo-ui-buttonElement-button' ).hide(); |
|||
if (typeof(element) != 'undefined' && element != null) |
|||
{ |
|||
alert('It Exists'); |
|||
document.getElementById(element).style.display="none" |
|||
break; |
|||
} |
|||
} |
|||
} |
} |
||
function savecahnges() |
|||
{ |
|||
//after the click of the appended buton the save button will be shown again on the screen by the following line of code |
|||
$("oo-ui-buttonElement-button").disabled = true; |
|||
} |
|||
editlink.addEventListener("click", editlinkcliked, false); |
editlink.addEventListener("click", editlinkcliked, false); |
||
//$(document).load(function () { |
|||
// alert('Loaded'); |
|||
//}); |
Latest revision as of 21:06, 11 February 2016
var editlink = document.getElementById("ca-ve-edit");
function editlinkcliked(evt) {
//creating button and appending it to the #p-views DOM, at which it will enable the save button after the click of "edit" link
$('#p-views').append('<input type="button" value="Confirm Modification" onclick="savecahnges()">');
//the save button is hiden from the screen by the following line of code
$( '#oo-ui-buttonElement-button' ).hide();
}
function savecahnges()
{
//after the click of the appended buton the save button will be shown again on the screen by the following line of code
$("oo-ui-buttonElement-button").disabled = true;
}
editlink.addEventListener("click", editlinkcliked, false);