view app/assets/javascripts/zp.clean_notice.coffee @ 373:6e3e1e7b0212

Handle unique error in model instead of controller.
author nanaya <me@myconan.net>
date Sat, 06 Jun 2015 22:12:56 +0900
parents 5a4d31e97937
children
line wrap: on
line source

window.zp.cleanNotice =
  init: ->
    if (history.replaceState)
      queryString = "?#{window.location.search.slice(1).replace(/(^|&)notice=[^&]*(&?)/, "$2")}"
      newPath = window.location.pathname
      newPath += queryString if queryString != "?"
      newPath += window.location.hash
      history.replaceState null, "", newPath