diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-07-04 17:00:29 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-07-04 17:00:29 -0400 |
commit | 0e5756ecc162a8428e6ab3820562f45ef17f9e8b (patch) | |
tree | 917c32afcf592814dad8e42fb64d3d52e227fae2 /assets | |
parent | 04300f6b5f25707f30ddfb45fd79417ce72b7234 (diff) |
Change alert box fadeout to avoid an empty space
Diffstat (limited to 'assets')
-rw-r--r-- | assets/css/app.css | 45 | ||||
-rw-r--r-- | assets/css/src/alert.css | 45 | ||||
-rw-r--r-- | assets/js/app.js | 8 | ||||
-rw-r--r-- | assets/js/src/base.js | 5 |
4 files changed, 21 insertions, 82 deletions
diff --git a/assets/css/app.css b/assets/css/app.css index e141cd25..37a9c890 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -494,9 +494,14 @@ a.btn-blue:focus, background: #f7f7f7; } /* alerts */ +#main .alert, +.page .alert { + margin-top: 10px; +} + .alert { padding: 8px 35px 8px 14px; - margin-bottom: 20px; + margin-bottom: 10px; color: #c09853; background-color: #fcf8e3; border: 1px solid #fbeed5; @@ -535,44 +540,6 @@ a.btn-blue:focus, .alert li { margin-left: 25px; } - -/* fade out animation */ -.alert-fade-out { - animation: fadeOut 1s forwards; - -webkit-animation: fadeOut 1s forwards; - animation-delay: 7s; - -webkit-animation-delay: 7s; - cursor: pointer; -} - -@-webkit-keyframes fadeOut { - from { - opacity: 1; - } - to { - opacity: 0; - margin: 0; - padding: 0; - height: 0; - } -} - -@keyframes fadeOut { - from { - opacity: 1; - } - to { - opacity: 0; - margin: 0; - padding: 0; - height: 0; - } -} - -#main .alert, -.page .alert { - margin-top: 10px; -} /* tooltip */ .tooltip-arrow:after { background: #fff; diff --git a/assets/css/src/alert.css b/assets/css/src/alert.css index 99dc417c..0a5a35ee 100644 --- a/assets/css/src/alert.css +++ b/assets/css/src/alert.css @@ -1,7 +1,12 @@ /* alerts */ +#main .alert, +.page .alert { + margin-top: 10px; +} + .alert { padding: 8px 35px 8px 14px; - margin-bottom: 20px; + margin-bottom: 10px; color: #c09853; background-color: #fcf8e3; border: 1px solid #fbeed5; @@ -40,41 +45,3 @@ .alert li { margin-left: 25px; } - -/* fade out animation */ -.alert-fade-out { - animation: fadeOut 1s forwards; - -webkit-animation: fadeOut 1s forwards; - animation-delay: 7s; - -webkit-animation-delay: 7s; - cursor: pointer; -} - -@-webkit-keyframes fadeOut { - from { - opacity: 1; - } - to { - opacity: 0; - margin: 0; - padding: 0; - height: 0; - } -} - -@keyframes fadeOut { - from { - opacity: 1; - } - to { - opacity: 0; - margin: 0; - padding: 0; - height: 0; - } -} - -#main .alert, -.page .alert { - margin-top: 10px; -} diff --git a/assets/js/app.js b/assets/js/app.js index ef1a4961..db33bec7 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -142,10 +142,10 @@ return""!=a?"visible"==document[a]:!0},SetStorageItem:function(a,c){"undefined"! c.parent().addClass("form-tab-selected");e.find(".markdown").html(a);e.css("height",f.css("height"));e.css("width",f.css("width"));d.hide();e.show()})},MarkdownWriter:function(a){a.preventDefault();$(this).closest("ul").find("li").removeClass("form-tab-selected");$(this).parent().addClass("form-tab-selected");$(".write-area").show();$(".preview-area").hide()},CheckSession:function(){$(".form-login").length||$.ajax({cache:!1,url:$("body").data("status-url"),statusCode:{401:function(){window.location= $("body").data("login-url")}}})},Init:function(){$(".chosen-select").chosen({width:"200px",no_results_text:$(".chosen-select").data("notfound"),disable_search_threshold:10});$("#board-selector").chosen({width:180,no_results_text:$("#board-selector").data("notfound")});$("#board-selector").change(function(){window.location=$(this).attr("data-board-url").replace(/PROJECT_ID/g,$(this).val())});window.setInterval(Kanboard.CheckSession,6E4);Mousetrap.bindGlobal("mod+enter",function(){$("form").submit()}); Mousetrap.bind("b",function(a){a.preventDefault();$("#board-selector").trigger("chosen:open")});Mousetrap.bind("f",function(a){a.preventDefault();(a=document.getElementById("form-search"))&&a.focus()});Mousetrap.bind("v b",function(a){a=$(".view-board");a.length&&(window.location=a.attr("href"))});Mousetrap.bind("v c",function(a){a=$(".view-calendar");a.length&&(window.location=a.attr("href"))});Mousetrap.bind("v l",function(a){a=$(".view-listing");a.length&&(window.location=a.attr("href"))});$(document).on("focus", -"#form-search",function(){$(this).val($(this).val())});$(document).on("click",".filter-helper",function(a){a.preventDefault();$("#form-search").val($(this).data("filter"));$("form.search").submit()});$.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]);Kanboard.InitAfterAjax()},InitAfterAjax:function(){$(document).on("click",".popover",Kanboard.Popover);$("[autofocus]").each(function(a,c){$(this).focus()});$(".form-date").datepicker({showOtherMonths:!0,selectOtherMonths:!0,dateFormat:"yy-mm-dd", -constrainInput:!1});$("#markdown-preview").click(Kanboard.MarkdownPreview);$("#markdown-write").click(Kanboard.MarkdownWriter);$(".auto-select").focus(function(){$(this).select()});$(".dropit-submenu").hide();$(".dropdown").not(".dropit").dropit({triggerParentEl:"span"});$(".task-autocomplete").length&&(""==$(".opposite_task_id").val()&&$(".task-autocomplete").parent().find("input[type=submit]").attr("disabled","disabled"),$(".task-autocomplete").autocomplete({source:$(".task-autocomplete").data("search-url"), -minLength:1,select:function(a,c){var b=$(".task-autocomplete").data("dst-field");$("input[name="+b+"]").val(c.item.id);$(".task-autocomplete").parent().find("input[type=submit]").removeAttr("disabled")}}));$(".column-tooltip").tooltip({content:function(){return'<div class="markdown">'+$(this).attr("title")+"</div>"},position:{my:"left-20 top",at:"center bottom+9",using:function(a,c){$(this).css(a);var b=c.target.left+c.target.width/2-c.element.left-20;$("<div>").addClass("tooltip-arrow").addClass(c.vertical).addClass(0== -b?"align-left":"align-right").appendTo(this)}}});Kanboard.Exists("screenshot-zone")&&Kanboard.Screenshot.Init()}}}(); +"#form-search",function(){$(this).val($(this).val())});$(document).on("click",".filter-helper",function(a){a.preventDefault();$("#form-search").val($(this).data("filter"));$("form.search").submit()});$.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]);$(".alert-fade-out").delay(4E3).fadeOut(800,function(){$(this).remove()});Kanboard.InitAfterAjax()},InitAfterAjax:function(){$(document).on("click",".popover",Kanboard.Popover);$("[autofocus]").each(function(a,c){$(this).focus()}); +$(".form-date").datepicker({showOtherMonths:!0,selectOtherMonths:!0,dateFormat:"yy-mm-dd",constrainInput:!1});$("#markdown-preview").click(Kanboard.MarkdownPreview);$("#markdown-write").click(Kanboard.MarkdownWriter);$(".auto-select").focus(function(){$(this).select()});$(".dropit-submenu").hide();$(".dropdown").not(".dropit").dropit({triggerParentEl:"span"});$(".task-autocomplete").length&&(""==$(".opposite_task_id").val()&&$(".task-autocomplete").parent().find("input[type=submit]").attr("disabled", +"disabled"),$(".task-autocomplete").autocomplete({source:$(".task-autocomplete").data("search-url"),minLength:1,select:function(a,c){var b=$(".task-autocomplete").data("dst-field");$("input[name="+b+"]").val(c.item.id);$(".task-autocomplete").parent().find("input[type=submit]").removeAttr("disabled")}}));$(".column-tooltip").tooltip({content:function(){return'<div class="markdown">'+$(this).attr("title")+"</div>"},position:{my:"left-20 top",at:"center bottom+9",using:function(a,c){$(this).css(a); +var b=c.target.left+c.target.width/2-c.element.left-20;$("<div>").addClass("tooltip-arrow").addClass(c.vertical).addClass(0==b?"align-left":"align-right").appendTo(this)}}});Kanboard.Exists("screenshot-zone")&&Kanboard.Screenshot.Init()}}}(); (function(){function a(a){a.preventDefault();a.stopPropagation();Kanboard.Popover(a,Kanboard.InitAfterAjax)}function c(){Mousetrap.bind("n",function(){Kanboard.OpenPopover($("#board").data("task-creation-url"),Kanboard.InitAfterAjax)});Mousetrap.bind("s",function(){"expanded"===(Kanboard.GetStorageItem(d())||"expanded")?(e(),Kanboard.SetStorageItem(d(),"collapsed")):(f(),Kanboard.SetStorageItem(d(),"expanded"))});Mousetrap.bind("c",function(){n()})}function b(){$(".filter-expand-link").click(function(a){a.preventDefault(); f();Kanboard.SetStorageItem(d(),"expanded")});$(".filter-collapse-link").click(function(a){a.preventDefault();e();Kanboard.SetStorageItem(d(),"collapsed")});k()}function d(){return"board_stacking_"+$("#board").data("project-id")}function e(){$(".filter-collapse").hide();$(".task-board-collapsed").show();$(".filter-expand").show();$(".task-board-expanded").hide()}function f(){$(".filter-collapse").show();$(".task-board-collapsed").hide();$(".filter-expand").hide();$(".task-board-expanded").show()} function k(){"expanded"===(Kanboard.GetStorageItem(d())||"expanded")?f():e()}function l(){$(".column").sortable({delay:300,distance:5,connectWith:".column",placeholder:"draggable-placeholder",items:".draggable-item",stop:function(a,b){g(b.item.attr("data-task-id"),b.item.parent().attr("data-column-id"),b.item.index()+1,b.item.parent().attr("data-swimlane-id"))}});$("#board").on("click",".task-board-popover",a);$("#board").on("click",".task-board",function(){window.location=$(this).data("task-url")}); diff --git a/assets/js/src/base.js b/assets/js/src/base.js index 043b78f7..ab9e59a9 100644 --- a/assets/js/src/base.js +++ b/assets/js/src/base.js @@ -249,6 +249,11 @@ var Kanboard = (function() { // Datepicker translation $.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]); + // Alert box fadeout + $(".alert-fade-out").delay(4000).fadeOut(800, function() { + $(this).remove(); + }); + Kanboard.InitAfterAjax(); }, |