dismissible minimum browser banner, closes #CNVS-5043
dismisses the banner for the browser session test plan: - use canvas in an unsupported browser (e.g. ie8, old firefox, or set your user agent to an unsupported one) - click the minimum browser warning at the top of the page - the warning should be dismissed - when visiting other canvas pages the warning should still be dismissed - restart the browser - the warning should be visible again Change-Id: I0d8bc966e8512e07dab0448f68a538a256228c4e Reviewed-on: https://gerrit.instructure.com/19623 Reviewed-by: Jon Jensen <jon@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> Product-Review: Joe Tanner <joe@instructure.com> QA-Review: Joe Tanner <joe@instructure.com>
This commit is contained in:
parent
894b1278bd
commit
3552fb3020
|
@ -4,6 +4,7 @@ define [
|
|||
'underscore'
|
||||
'compiled/fn/preventDefault'
|
||||
'jqueryui/effects/drop'
|
||||
'vendor/jquery.cookie'
|
||||
], (I18n, _, preventDefault) ->
|
||||
|
||||
$buffer = $("#flash_message_buffer")
|
||||
|
@ -12,6 +13,7 @@ define [
|
|||
$holder.on 'click', 'li', ->
|
||||
$this = $(this)
|
||||
return if $this.hasClass('no_close')
|
||||
$.cookie('unsupported_browser_dismissed', '1') if $this.hasClass('unsupported_browser')
|
||||
$this.stop(true, true).remove()
|
||||
if (bufferIndex = $this.data('buffer-index'))?
|
||||
$buffer.find("[data-buffer-index=#{bufferIndex}]").remove()
|
||||
|
|
|
@ -1369,7 +1369,9 @@ class ApplicationController < ActionController::Base
|
|||
def flash_notices
|
||||
@notices ||= begin
|
||||
notices = []
|
||||
notices << {:type => 'warning', :content => unsupported_browser, :classes => 'no_close'} if !browser_supported? && !@embedded_view
|
||||
if !browser_supported? && !@embedded_view && !cookies['unsupported_browser_dismissed']
|
||||
notices << {:type => 'warning', :content => unsupported_browser, :classes => 'unsupported_browser'}
|
||||
end
|
||||
if error = flash.delete(:error)
|
||||
notices << {:type => 'error', :content => error}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue