{"id":26781688,"url":"https://github.com/pixelunion/bc-loading","last_synced_at":"2025-03-29T08:17:32.622Z","repository":{"id":47972417,"uuid":"132650091","full_name":"pixelunion/bc-loading","owner":"pixelunion","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-05T22:23:20.000Z","size":159,"stargazers_count":0,"open_issues_count":5,"forks_count":3,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-03-26T12:58:29.984Z","etag":null,"topics":["library"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixelunion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-08T18:39:28.000Z","updated_at":"2021-05-14T21:56:02.000Z","dependencies_parsed_at":"2023-02-04T20:32:22.858Z","dependency_job_id":null,"html_url":"https://github.com/pixelunion/bc-loading","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-loading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-loading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-loading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-loading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelunion","download_url":"https://codeload.github.com/pixelunion/bc-loading/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246156411,"owners_count":20732397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library"],"created_at":"2025-03-29T08:17:31.826Z","updated_at":"2025-03-29T08:17:32.607Z","avatar_url":"https://github.com/pixelunion.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BigCommerce Loading Overlay Module\n\nScope an overlay to a specific area, or cover the whole page (for use while waiting on API response).\n\n### Installation\n\nNPM:\n```\nnpm install --save github:pixelunion/bc-loading\n```\n\n\n### Usage\n\n```\nimport $ from 'jquery';\nimport Loading from 'bc-loading';\n\nconst loadingOptions = {\n  loadingMarkup: '\u003cdiv class=\"loading\"\u003e\u003cspan class=\"loading-spinner\"\u003e\u003c/span\u003e\u003c/div\u003e',\n  visibleClass: 'visible',\n  scrollLockClass: 'scroll-locked',\n};\n\nconst cartTotalsOverlay = new Loading(loadingOptions, false, '[data-cart-totals]');\n\nconst shippingCalculator = new ShippingCalculator({\n  willUpdate: () =\u003e cartTotalsOverlay.show(),\n  didUpdate: () =\u003e cartTotalsOverlay.hide(),\n});\n```\n\n\n### Options\n\nInstantiate with:\n`new Loading(options, scrollLock, scope);`\n\n**loadingMarkup:** Simple markup comprsing your loading overlay.\n\n**visibleClass:** Class to be applied to show overlay (e.g, `'visible'`).\n\n**scrollLockClass** Class to be applied to stop the body from scrolling (e.g, `'scroll-locked'`).\n\n**scrollLock** Pass a boolean value into each instance of the loading overlay to dictate whether or not the scroll lock should be used.\n\n**scope** Pass an element selector into each instance of the loading overlay to scope the overlay to a particular area (defaults to `'body'`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelunion%2Fbc-loading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelunion%2Fbc-loading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelunion%2Fbc-loading/lists"}