aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js42
1 files changed, 31 insertions, 11 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 96adf0be3..1d6eca91d 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -444,16 +444,18 @@ function contextualHelp() {
}
function contextualHelpFocus(target, openSidePanel) {
- if (openSidePanel) {
- $("main").addClass('region_1-on'); // Open the side panel to highlight element
- }
- else {
- $("main").removeClass('region_1-on');
- }
- $('html,body').animate({ scrollTop: $(target).offset().top - $('nav').outerHeight(true) - $('#contextual-help-content').outerHeight(true)}, 'slow');
- for (i = 0; i < 3; i++) {
- $(target).fadeTo('slow', 0.1).fadeTo('slow', 1.0);
- }
+ if($(target).length) {
+ if (openSidePanel) {
+ $("main").addClass('region_1-on'); // Open the side panel to highlight element
+ }
+ else {
+ $("main").removeClass('region_1-on');
+ }
+ $('html,body').animate({ scrollTop: $(target).offset().top - $('nav').outerHeight(true) - $('#contextual-help-content').outerHeight(true)}, 'slow');
+ for (i = 0; i < 3; i++) {
+ $(target).fadeTo('slow', 0.1).fadeTo('slow', 1.0);
+ }
+ }
}
function updatePageItems(mode, data) {
@@ -1144,6 +1146,25 @@ function preview_post() {
return true;
}
+function preview_mail() {
+ $("#mail-preview").val("1");
+ $("#mail-preview-content").show();
+ $.post(
+ "mail",
+ $("#prvmail-form").serialize(),
+ function(data) {
+ if(data.preview) {
+ $("#mail-preview-content").html(data.preview);
+ $("#mail-preview-content" + " a").click(function() { return false; });
+ }
+ },
+ "json"
+ );
+ $("#mail-preview").val("0");
+ return true;
+}
+
+
function unpause() {
// unpause auto reloads if they are currently stopped
totStopped = false;
@@ -1313,7 +1334,6 @@ $(document).ready(function() {
numbers : aStr['t17'],
};
- $("#toc").toc();
});
function zFormError(elm,x) {