Skip to content

Commit

Permalink
add a js issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaff committed Feb 5, 2016
1 parent e862ae6 commit 9cf416c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/assets/javascripts/admin_publify.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* typewatch() borrowed from http://stackoverflow.com/questions/2219924/idiomatic-jquery-delayed-event-only-after-a-short-pause-in-typing-e-g-timew */
var typewatch = (function(){
var typewatch = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
}
}
})();

function autosave_request(e) {
Expand Down Expand Up @@ -41,7 +41,7 @@ function tag_manager() {
}

function save_article_tags() {
$('#article_keywords').val($('#article_form').find('input[name="hidden-article[keywords]"]').val());
$('#article_keywords').val($('#article_form').find('input[name="hidden-article[keywords]"]'));
}

function doneTyping () {
Expand All @@ -53,17 +53,17 @@ function doneTyping () {
function set_savebar() {
var typingTimer;
var doneTypingInterval = 3000;

$( "#article_body_and_extended" ).keydown(function() {
$( "#save-bar").fadeOut(2000, function() {

});
clearTimeout(typingTimer);
});

$('#article_body_and_extended').keyup(function(){
typingTimer = setTimeout(doneTyping, doneTypingInterval);
});
});
}

// From http://www.shawnolson.net/scripts/public_smo_scripts.js
Expand All @@ -88,4 +88,4 @@ $(document).ready(function() {
$(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
event.preventDefault();
$(this).ekkoLightbox();
});
});

0 comments on commit 9cf416c

Please sign in to comment.