Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !3149

Audio/Video issue with HTML5 in a Modal

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/ivebeenlinuxed/AV-modal into master Apr 19, 2012
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: ivebeenlinuxed

Hi,

Apologies if I'm doing this all wrong, but I noticed a bug today which wouldn't allow you to click HTML5 audio/video controls (Chrome tested) when embedding them in a Bootstrap modal window. Fix is included in this small patch.

If I'm doing things wrong let me know! I can only learn what I am taught, and contributing to open source projects is new to me.

diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js
index e929706..ef63ed5 100644
--- a/js/bootstrap-modal.js
+++ b/js/bootstrap-modal.js
@@ -201,10 +201,11 @@
       var $this = $(this), href
         , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
         , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
-
-      e.preventDefault()
+      if (!$(e.target).is("audio,video")) {
+        e.preventDefault()
+      }
       $target.modal(option)
     })
   })

-}( window.jQuery );
\ No newline at end of file
+}( window.jQuery );
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/ivebeenlinuxed/AV-modal