This commit is contained in:
GEGULA�
2017-08-17 15:18:57 +08:00
parent 8f83750ce9
commit 43e000169e
+69
View File
@@ -1343,6 +1343,7 @@ License: You must have a valid license purchased only from themeforest(the above
<script src="../assets/layouts/global/scripts/quick-nav.min.js" type="text/javascript"></script>
<!-- END THEME LAYOUT SCRIPTS -->
<script>
$(document).ready(function()
{
@@ -1369,6 +1370,74 @@ License: You must have a valid license purchased only from themeforest(the above
document.getElementById("with_content").style.display = "";
}
</script>
<script type="text/javascript">
function show_content(){
//alert('hoooo');
document.getElementById("without_content").style.display = "none";
document.getElementById("with_content").style.display = "";
var elements = getElementsByClassName('editInPlace', '*', document);
for (var i = 0; i < elements.length; i++) {
elements[i].ondblclick = function() {
this.setAttribute('oldText', this.innerHTML); // not actually required. I use this just in case you want to cancel and set the original text back.
var textBox = document.createElement('INPUT');
textBox.setAttribute('type', 'text');
textBox.value = this.innerHTML;
textBox.onblur = function() {
var newValue = this.value;
this.parentNode.innerHTML = newValue;
//alert("Your new value: \n\n" + newValue);
}
this.innerHTML = '';
this.appendChild(textBox);
}
}(i);
}
window.onload = function() {
var elements = getElementsByClassName('editInPlace', '*', document);
for (var i = 0; i < elements.length; i++) {
elements[i].ondblclick = function() {
this.setAttribute('oldText', this.innerHTML); // not actually required. I use this just in case you want to cancel and set the original text back.
var textBox = document.createElement('INPUT');
textBox.setAttribute('type', 'text');
textBox.value = this.innerHTML;
textBox.onblur = function() {
var newValue = this.value;
this.parentNode.innerHTML = newValue;
//alert("Your new value: \n\n" + newValue);
}
this.innerHTML = '';
this.appendChild(textBox);
}
}(i);
}
function getElementsByClassName(className, tag, elm) {
var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
var tag = tag || "*";
var elm = elm || document;
var elements = (tag == "*" && elm.all) ? elm.all : elm.getElementsByTagName(tag);
var returnElements = [];
var current;
var length = elements.length;
for (var i = 0; i < length; i++) {
current = elements[i];
if (testClass.test(current.className)) {
returnElements.push(current);
}
}
return returnElements;
}
$('[data-toggle="popover"]').popover({trigger: 'focus'})
</script>
</body>
</html>