solidus_backend 2.1.1 → 2.2.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.eslintrc +21 -0
- data/Gemfile +3 -0
- data/Rakefile +30 -1
- data/app/assets/config/solidus_backend_manifest.js +6 -0
- data/app/assets/javascripts/spree/backend.js +11 -7
- data/app/assets/javascripts/spree/backend/address_states.js +1 -1
- data/app/assets/javascripts/spree/backend/admin.js +11 -11
- data/app/assets/javascripts/spree/backend/calculator.js +24 -14
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +9 -96
- data/app/assets/javascripts/spree/backend/collections/index.js +2 -0
- data/app/assets/javascripts/spree/backend/collections/line_items.js +9 -0
- data/app/assets/javascripts/spree/backend/collections/states.js +13 -0
- data/app/assets/javascripts/spree/backend/components/number_with_currency.js +12 -0
- data/app/assets/javascripts/spree/backend/components/tooltips.js +2 -1
- data/app/assets/javascripts/spree/backend/format_money.js +11 -0
- data/app/assets/javascripts/spree/backend/handlebars_extensions.js +18 -0
- data/app/assets/javascripts/spree/backend/images/upload.js +1 -1
- data/app/assets/javascripts/spree/backend/models/address.js +2 -0
- data/app/assets/javascripts/spree/backend/models/index.js +2 -0
- data/app/assets/javascripts/spree/backend/models/line_item.js +7 -0
- data/app/assets/javascripts/spree/backend/models/order.js +37 -0
- data/app/assets/javascripts/spree/backend/namespaces.js +9 -0
- data/app/assets/javascripts/spree/backend/orders/cart.js +55 -0
- data/app/assets/javascripts/spree/backend/orders/index.js +2 -0
- data/app/assets/javascripts/spree/backend/payments/edit.js.coffee +0 -1
- data/app/assets/javascripts/spree/backend/payments/new.js +0 -11
- data/app/assets/javascripts/spree/backend/promotions.js.coffee +48 -50
- data/app/assets/javascripts/spree/backend/promotions/activation.js +26 -0
- data/app/assets/javascripts/spree/backend/returns/return_item_selection.js +16 -16
- data/app/assets/javascripts/spree/backend/shipments.js +1 -1
- data/app/assets/javascripts/spree/backend/spree-select2.js +1 -6
- data/app/assets/javascripts/spree/backend/stock_transfers/variant_form.coffee +1 -1
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +0 -5
- data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +9 -9
- data/app/assets/javascripts/spree/backend/taxons.js.coffee +7 -7
- data/app/assets/javascripts/spree/backend/templates/_image.hbs +5 -0
- data/app/assets/javascripts/spree/backend/templates/index.js +3 -0
- data/app/assets/javascripts/spree/backend/templates/orders/details_adjustment_row.hbs +4 -0
- data/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs +42 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_flat_rate.hbs +2 -2
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_percent.hbs +2 -2
- data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values.hbs +2 -2
- data/app/assets/javascripts/spree/backend/templates/stock_transfers/{transfer_item.hbs.erb → transfer_item.hbs} +1 -5
- data/app/assets/javascripts/spree/backend/templates/variants/{autocomplete.hbs.erb → autocomplete.hbs} +1 -5
- data/app/assets/javascripts/spree/backend/templates/variants/line_items_autocomplete_stock.hbs +18 -59
- data/app/assets/javascripts/spree/backend/translation.js +29 -0
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee +5 -4
- data/app/assets/javascripts/spree/backend/views/cart/add_line_item_button.js +19 -0
- data/app/assets/javascripts/spree/backend/views/cart/line_item_row.js +88 -0
- data/app/assets/javascripts/spree/backend/views/cart/line_item_table.js +11 -0
- data/app/assets/javascripts/spree/backend/views/index.js +12 -0
- data/app/assets/javascripts/spree/backend/views/number_with_currency.js +31 -0
- data/app/assets/javascripts/spree/backend/views/order/address.js +52 -0
- data/app/assets/javascripts/spree/backend/views/order/customer_details.js +68 -0
- data/app/assets/javascripts/spree/backend/views/order/customer_select.js +55 -0
- data/app/assets/javascripts/spree/backend/views/order/details_adjustments.js +39 -0
- data/app/assets/javascripts/spree/backend/views/order/details_total.js +12 -0
- data/app/assets/javascripts/spree/backend/views/order/summary.js +36 -0
- data/app/assets/javascripts/spree/backend/views/state_select.js +71 -0
- data/app/assets/javascripts/spree/backend/views/zones/form.js +16 -0
- data/app/assets/javascripts/spree/backend/zone.js +8 -0
- data/app/assets/stylesheets/spree/backend.css +1 -1
- data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +542 -246
- data/app/assets/stylesheets/spree/backend/components/_date-picker.scss +5 -7
- data/app/assets/stylesheets/spree/backend/components/_image_placeholder.scss +24 -0
- data/app/assets/stylesheets/spree/backend/components/_messages.scss +8 -8
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +6 -15
- data/app/assets/stylesheets/spree/backend/components/_number_with_currency.scss +39 -0
- data/app/assets/stylesheets/spree/backend/components/_progress.scss +5 -5
- data/app/assets/stylesheets/spree/backend/components/_states.scss +6 -6
- data/app/assets/stylesheets/spree/backend/components/_stock_table.scss +1 -2
- data/app/assets/stylesheets/spree/backend/components/_tabs.scss +9 -9
- data/app/assets/stylesheets/spree/backend/globals/_deprecation.scss +17 -0
- data/app/assets/stylesheets/spree/backend/globals/_variables.scss +25 -4
- data/app/assets/stylesheets/spree/backend/globals/mixins/_line_through.scss +1 -1
- data/app/assets/stylesheets/spree/backend/plugins/_bootstrap_tooltip.scss +4 -4
- data/app/assets/stylesheets/spree/backend/plugins/_select2.scss +64 -187
- data/app/assets/stylesheets/spree/backend/sections/_log_entries.scss +3 -3
- data/app/assets/stylesheets/spree/backend/sections/_orders.scss +16 -20
- data/app/assets/stylesheets/spree/backend/sections/_products.scss +2 -2
- data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +7 -2
- data/app/assets/stylesheets/spree/backend/sections/_return_authorizations.scss +0 -14
- data/app/assets/stylesheets/spree/backend/sections/_stock_management.scss +2 -2
- data/app/assets/stylesheets/spree/backend/sections/_store_credits.scss +0 -6
- data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +6 -6
- data/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +1 -1
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +31 -123
- data/app/assets/stylesheets/spree/backend/shared/_header.scss +5 -4
- data/app/assets/stylesheets/spree/backend/shared/_icons.scss +1 -1
- data/app/assets/stylesheets/spree/backend/shared/_images.scss +7 -0
- data/app/assets/stylesheets/spree/backend/shared/_layout.scss +4 -14
- data/app/assets/stylesheets/spree/backend/shared/_tables.scss +21 -32
- data/app/assets/stylesheets/spree/backend/shared/_typography.scss +14 -47
- data/app/assets/stylesheets/spree/backend/spree_admin.scss +4 -0
- data/app/controllers/spree/admin/adjustments_controller.rb +1 -1
- data/app/controllers/spree/admin/base_controller.rb +1 -1
- data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
- data/app/controllers/spree/admin/customer_returns_controller.rb +2 -0
- data/app/controllers/spree/admin/general_settings_controller.rb +1 -27
- data/app/controllers/spree/admin/images_controller.rb +1 -1
- data/app/controllers/spree/admin/option_types_controller.rb +4 -4
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
- data/app/controllers/spree/admin/orders_controller.rb +2 -2
- data/app/controllers/spree/admin/payment_methods_controller.rb +1 -1
- data/app/controllers/spree/admin/payments_controller.rb +4 -4
- data/app/controllers/spree/admin/products_controller.rb +6 -6
- data/app/controllers/spree/admin/promotion_code_batches_controller.rb +28 -0
- data/app/controllers/spree/admin/promotion_codes_controller.rb +7 -3
- data/app/controllers/spree/admin/promotions_controller.rb +13 -23
- data/app/controllers/spree/admin/refunds_controller.rb +1 -1
- data/app/controllers/spree/admin/reimbursements_controller.rb +4 -2
- data/app/controllers/spree/admin/search_controller.rb +2 -2
- data/app/controllers/spree/admin/shipping_methods_controller.rb +2 -2
- data/app/controllers/spree/admin/states_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_items_controller.rb +3 -3
- data/app/controllers/spree/admin/stock_transfers_controller.rb +2 -2
- data/app/controllers/spree/admin/store_credits_controller.rb +8 -2
- data/app/controllers/spree/admin/stores_controller.rb +23 -0
- data/app/controllers/spree/admin/tax_rates_controller.rb +3 -3
- data/app/controllers/spree/admin/taxons_controller.rb +5 -5
- data/app/controllers/spree/admin/users_controller.rb +1 -8
- data/app/controllers/spree/admin/variants_controller.rb +9 -2
- data/app/controllers/spree/admin/zones_controller.rb +3 -3
- data/app/helpers/spree/admin/base_helper.rb +2 -1
- data/app/helpers/spree/admin/navigation_helper.rb +2 -2
- data/app/models/spree/backend_configuration.rb +3 -3
- data/app/views/spree/admin/adjustment_reasons/edit.html.erb +3 -3
- data/app/views/spree/admin/adjustment_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/adjustment_reasons/new.html.erb +3 -3
- data/app/views/spree/admin/adjustment_reasons/shared/_form.html.erb +3 -3
- data/app/views/spree/admin/adjustments/_adjustment.html.erb +2 -2
- data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +1 -1
- data/app/views/spree/admin/adjustments/_form.html.erb +3 -3
- data/app/views/spree/admin/adjustments/edit.html.erb +5 -5
- data/app/views/spree/admin/adjustments/index.html.erb +4 -4
- data/app/views/spree/admin/adjustments/new.html.erb +4 -4
- data/app/views/spree/admin/cancellations/index.html.erb +1 -1
- data/app/views/spree/admin/countries/_form.html.erb +5 -5
- data/app/views/spree/admin/countries/edit.html.erb +3 -3
- data/app/views/spree/admin/countries/index.html.erb +3 -3
- data/app/views/spree/admin/countries/new.html.erb +3 -3
- data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +6 -6
- data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +5 -5
- data/app/views/spree/admin/customer_returns/edit.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/index.html.erb +2 -2
- data/app/views/spree/admin/customer_returns/new.html.erb +5 -5
- data/app/views/spree/admin/images/_form.html.erb +2 -2
- data/app/views/spree/admin/images/_image_row.html.erb +5 -3
- data/app/views/spree/admin/images/edit.html.erb +7 -7
- data/app/views/spree/admin/images/index.html.erb +3 -3
- data/app/views/spree/admin/images/new.html.erb +3 -3
- data/app/views/spree/admin/log_entries/index.html.erb +1 -1
- data/app/views/spree/admin/option_types/_form.html.erb +4 -4
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
- data/app/views/spree/admin/option_types/edit.html.erb +5 -5
- data/app/views/spree/admin/option_types/index.html.erb +4 -4
- data/app/views/spree/admin/option_types/new.html.erb +3 -3
- data/app/views/spree/admin/option_types/new.js.erb +1 -1
- data/app/views/spree/admin/orders/_add_line_item.html.erb +2 -2
- data/app/views/spree/admin/orders/_add_product.html.erb +3 -6
- data/app/views/spree/admin/orders/_adjustments.html.erb +18 -20
- data/app/views/spree/admin/orders/_carton_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/_form.html.erb +5 -29
- data/app/views/spree/admin/orders/_line_items.html.erb +22 -48
- data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +6 -31
- data/app/views/spree/admin/orders/_order_details.html.erb +32 -0
- data/app/views/spree/admin/orders/_shipment.html.erb +10 -13
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +3 -3
- data/app/views/spree/admin/orders/cart.html.erb +4 -14
- data/app/views/spree/admin/orders/confirm.html.erb +3 -3
- data/app/views/spree/admin/orders/confirm/_customer_details.html.erb +2 -2
- data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
- data/app/views/spree/admin/orders/confirm/_shipment_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +24 -20
- data/app/views/spree/admin/orders/customer_details/edit.html.erb +13 -11
- data/app/views/spree/admin/orders/customer_details/show.html.erb +2 -2
- data/app/views/spree/admin/orders/edit.html.erb +2 -1
- data/app/views/spree/admin/orders/index.html.erb +22 -20
- data/app/views/spree/admin/payment_methods/_form.html.erb +6 -6
- data/app/views/spree/admin/payment_methods/edit.html.erb +3 -3
- data/app/views/spree/admin/payment_methods/index.html.erb +4 -4
- data/app/views/spree/admin/payment_methods/new.html.erb +3 -3
- data/app/views/spree/admin/payments/_form.html.erb +10 -8
- data/app/views/spree/admin/payments/_list.html.erb +2 -2
- data/app/views/spree/admin/payments/credit.html.erb +1 -1
- data/app/views/spree/admin/payments/index.html.erb +3 -3
- data/app/views/spree/admin/payments/new.html.erb +4 -4
- data/app/views/spree/admin/payments/show.html.erb +3 -3
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +6 -9
- data/app/views/spree/admin/payments/source_views/_gateway.html.erb +1 -1
- data/app/views/spree/admin/payments/source_views/_storecredit.html.erb +1 -1
- data/app/views/spree/admin/prices/_form.html.erb +4 -15
- data/app/views/spree/admin/prices/_master_variant_table.html.erb +3 -3
- data/app/views/spree/admin/prices/_table.html.erb +2 -2
- data/app/views/spree/admin/prices/edit.html.erb +1 -1
- data/app/views/spree/admin/prices/index.html.erb +6 -6
- data/app/views/spree/admin/prices/new.html.erb +2 -2
- data/app/views/spree/admin/prices/new.js.erb +1 -1
- data/app/views/spree/admin/product_properties/index.html.erb +5 -5
- data/app/views/spree/admin/products/_form.html.erb +21 -27
- data/app/views/spree/admin/products/edit.html.erb +6 -6
- data/app/views/spree/admin/products/index.html.erb +15 -15
- data/app/views/spree/admin/products/new.html.erb +14 -14
- data/app/views/spree/admin/products/new.js.erb +1 -1
- data/app/views/spree/admin/promotion_actions/create.js.erb +3 -2
- data/app/views/spree/admin/promotion_categories/_form.html.erb +4 -4
- data/app/views/spree/admin/promotion_categories/edit.html.erb +3 -3
- data/app/views/spree/admin/promotion_categories/index.html.erb +2 -2
- data/app/views/spree/admin/promotion_categories/new.html.erb +3 -3
- data/app/views/spree/admin/promotion_code_batches/download.csv.ruby +6 -0
- data/app/views/spree/admin/promotion_code_batches/index.html.erb +65 -0
- data/app/views/spree/admin/promotion_code_batches/new.html.erb +23 -0
- data/app/views/spree/admin/promotion_codes/index.csv.ruby +1 -1
- data/app/views/spree/admin/promotion_codes/index.html.erb +28 -0
- data/app/views/spree/admin/promotion_rules/create.js.erb +1 -1
- data/app/views/spree/admin/promotions/_actions.html.erb +4 -4
- data/app/views/spree/admin/promotions/_activations_edit.html.erb +22 -0
- data/app/views/spree/admin/promotions/_activations_new.html.erb +66 -0
- data/app/views/spree/admin/promotions/_form.html.erb +51 -64
- data/app/views/spree/admin/promotions/_promotion_action.html.erb +4 -4
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +4 -4
- data/app/views/spree/admin/promotions/_rules.html.erb +6 -8
- data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +2 -2
- data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +21 -22
- data/app/views/spree/admin/promotions/calculators/flat_rate/_fields.html.erb +4 -0
- data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +8 -6
- data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +8 -6
- data/app/views/spree/admin/promotions/edit.html.erb +15 -12
- data/app/views/spree/admin/promotions/index.html.erb +9 -9
- data/app/views/spree/admin/promotions/new.html.erb +5 -6
- data/app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb +3 -3
- data/app/views/spree/admin/promotions/rules/_item_total.html.erb +7 -10
- data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +2 -2
- data/app/views/spree/admin/promotions/rules/_nth_order.html.erb +4 -4
- data/app/views/spree/admin/promotions/rules/_option_value.html.erb +3 -3
- data/app/views/spree/admin/promotions/rules/_product.html.erb +4 -4
- data/app/views/spree/admin/promotions/rules/_taxon.html.erb +4 -4
- data/app/views/spree/admin/promotions/rules/_user.html.erb +1 -1
- data/app/views/spree/admin/properties/_form.html.erb +4 -4
- data/app/views/spree/admin/properties/edit.html.erb +3 -3
- data/app/views/spree/admin/properties/index.html.erb +7 -7
- data/app/views/spree/admin/properties/new.html.erb +3 -3
- data/app/views/spree/admin/properties/new.js.erb +1 -1
- data/app/views/spree/admin/refund_reasons/edit.html.erb +3 -3
- data/app/views/spree/admin/refund_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/refund_reasons/new.html.erb +3 -3
- data/app/views/spree/admin/refund_reasons/shared/_form.html.erb +3 -3
- data/app/views/spree/admin/refunds/edit.html.erb +2 -2
- data/app/views/spree/admin/refunds/new.html.erb +4 -4
- data/app/views/spree/admin/reimbursements/edit.html.erb +6 -6
- data/app/views/spree/admin/reimbursements/index.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/show.html.erb +6 -6
- data/app/views/spree/admin/reports/sales_total.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +3 -7
- data/app/views/spree/admin/return_authorizations/edit.html.erb +3 -3
- data/app/views/spree/admin/return_authorizations/index.html.erb +3 -3
- data/app/views/spree/admin/return_authorizations/new.html.erb +3 -3
- data/app/views/spree/admin/shared/_address_form.html.erb +12 -20
- data/app/views/spree/admin/shared/_calculator_fields.html.erb +10 -13
- data/app/views/spree/admin/shared/_configuration_menu.html.erb +2 -2
- data/app/views/spree/admin/shared/_head.html.erb +1 -1
- data/app/views/spree/admin/shared/_image.html.erb +7 -0
- data/app/views/spree/admin/shared/_js_locale_data.html.erb +47 -0
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
- data/app/views/spree/admin/shared/_number_with_currency.html.erb +16 -0
- data/app/views/spree/admin/shared/_order_submenu.html.erb +1 -1
- data/app/views/spree/admin/shared/_order_summary.html.erb +16 -17
- data/app/views/spree/admin/shared/_product_tabs.html.erb +6 -6
- data/app/views/spree/admin/shared/_report_criteria.html.erb +7 -7
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +9 -9
- data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +2 -2
- data/app/views/spree/admin/shared/_sidebar.html.erb +1 -1
- data/app/views/spree/admin/shared/_variant_search.html.erb +4 -4
- data/app/views/spree/admin/shared/named_types/_edit.html.erb +3 -3
- data/app/views/spree/admin/shared/named_types/_form.html.erb +8 -10
- data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
- data/app/views/spree/admin/shared/named_types/_new.html.erb +3 -3
- data/app/views/spree/admin/shipping_categories/edit.html.erb +3 -3
- data/app/views/spree/admin/shipping_categories/index.html.erb +3 -3
- data/app/views/spree/admin/shipping_categories/new.html.erb +3 -3
- data/app/views/spree/admin/shipping_methods/_form.html.erb +15 -15
- data/app/views/spree/admin/shipping_methods/edit.html.erb +3 -3
- data/app/views/spree/admin/shipping_methods/index.html.erb +4 -4
- data/app/views/spree/admin/shipping_methods/new.html.erb +3 -3
- data/app/views/spree/admin/states/_form.html.erb +4 -4
- data/app/views/spree/admin/states/_new.html.erb +2 -2
- data/app/views/spree/admin/states/_state_list.html.erb +2 -2
- data/app/views/spree/admin/states/edit.html.erb +3 -3
- data/app/views/spree/admin/states/index.html.erb +6 -6
- data/app/views/spree/admin/states/new.html.erb +3 -3
- data/app/views/spree/admin/stock_items/_stock_management.html.erb +3 -3
- data/app/views/spree/admin/stock_items/index.html.erb +4 -4
- data/app/views/spree/admin/stock_locations/_form.html.erb +10 -10
- data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +5 -5
- data/app/views/spree/admin/stock_locations/edit.html.erb +3 -3
- data/app/views/spree/admin/stock_locations/index.html.erb +4 -4
- data/app/views/spree/admin/stock_locations/new.html.erb +3 -3
- data/app/views/spree/admin/stock_movements/index.html.erb +2 -8
- data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/_transfer_item_table.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/edit.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/index.html.erb +9 -9
- data/app/views/spree/admin/stock_transfers/receive.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/show.html.erb +5 -5
- data/app/views/spree/admin/store_credits/_form.html.erb +7 -6
- data/app/views/spree/admin/store_credits/_update_reason_field.html.erb +1 -1
- data/app/views/spree/admin/store_credits/edit_amount.html.erb +1 -1
- data/app/views/spree/admin/store_credits/index.html.erb +14 -11
- data/app/views/spree/admin/store_credits/new.html.erb +2 -2
- data/app/views/spree/admin/stores/_form.html.erb +51 -0
- data/app/views/spree/admin/stores/edit.html.erb +19 -0
- data/app/views/spree/admin/stores/index.html.erb +41 -0
- data/app/views/spree/admin/stores/new.html.erb +15 -0
- data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +10 -8
- data/app/views/spree/admin/style_guide/topics/tables/_building_tables.html.erb +23 -4
- data/app/views/spree/admin/tax_categories/_form.html.erb +8 -8
- data/app/views/spree/admin/tax_categories/edit.html.erb +3 -3
- data/app/views/spree/admin/tax_categories/index.html.erb +4 -4
- data/app/views/spree/admin/tax_categories/new.html.erb +3 -3
- data/app/views/spree/admin/tax_rates/_form.html.erb +7 -7
- data/app/views/spree/admin/tax_rates/edit.html.erb +3 -3
- data/app/views/spree/admin/tax_rates/index.html.erb +3 -3
- data/app/views/spree/admin/tax_rates/new.html.erb +3 -3
- data/app/views/spree/admin/taxonomies/_form.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/_list.html.erb +2 -2
- data/app/views/spree/admin/taxonomies/_taxon.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/edit.erb +1 -1
- data/app/views/spree/admin/taxonomies/index.html.erb +2 -2
- data/app/views/spree/admin/taxonomies/new.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +10 -10
- data/app/views/spree/admin/taxons/_taxon_table.html.erb +1 -1
- data/app/views/spree/admin/taxons/edit.html.erb +2 -2
- data/app/views/spree/admin/taxons/index.html.erb +2 -2
- data/app/views/spree/admin/users/_addresses_form.html.erb +4 -4
- data/app/views/spree/admin/users/_form.html.erb +8 -7
- data/app/views/spree/admin/users/addresses.html.erb +5 -5
- data/app/views/spree/admin/users/edit.html.erb +15 -15
- data/app/views/spree/admin/users/index.html.erb +5 -5
- data/app/views/spree/admin/users/items.html.erb +7 -7
- data/app/views/spree/admin/users/new.html.erb +3 -3
- data/app/views/spree/admin/users/orders.html.erb +7 -7
- data/app/views/spree/admin/variants/_form.html.erb +14 -14
- data/app/views/spree/admin/variants/_table.html.erb +2 -2
- data/app/views/spree/admin/variants/_table_filter.html.erb +3 -3
- data/app/views/spree/admin/variants/edit.html.erb +4 -4
- data/app/views/spree/admin/variants/index.html.erb +2 -2
- data/app/views/spree/admin/variants/new.html.erb +4 -4
- data/app/views/spree/admin/variants/new.js.erb +1 -1
- data/app/views/spree/admin/zones/_country_members.html.erb +1 -1
- data/app/views/spree/admin/zones/_form.html.erb +9 -9
- data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
- data/app/views/spree/admin/zones/edit.html.erb +3 -3
- data/app/views/spree/admin/zones/index.html.erb +6 -6
- data/app/views/spree/admin/zones/new.html.erb +3 -3
- data/app/views/spree/layouts/admin.html.erb +3 -3
- data/app/views/spree/layouts/admin_style_guide.html.erb +1 -1
- data/config/initializers/assets.rb +1 -7
- data/config/routes.rb +6 -2
- data/lib/spree/backend.rb +0 -1
- data/lib/spree/backend/engine.rb +0 -5
- data/solidus_backend.gemspec +0 -1
- data/spec/controllers/spree/admin/payments_controller_spec.rb +21 -7
- data/spec/controllers/spree/admin/promotions_controller_spec.rb +30 -36
- data/spec/controllers/spree/admin/store_credits_controller_spec.rb +1 -0
- data/spec/controllers/spree/admin/users_controller_spec.rb +9 -1
- data/spec/features/admin/configuration/payment_methods_spec.rb +1 -1
- data/spec/features/admin/configuration/shipping_methods_spec.rb +21 -13
- data/spec/features/admin/configuration/stock_locations_spec.rb +3 -2
- data/spec/features/admin/configuration/{general_settings_spec.rb → store_spec.rb} +8 -9
- data/spec/features/admin/javascript_format_money_spec.rb +20 -0
- data/spec/features/admin/orders/customer_details_spec.rb +16 -12
- data/spec/features/admin/orders/line_items_spec.rb +2 -2
- data/spec/features/admin/orders/listing_spec.rb +25 -10
- data/spec/features/admin/orders/new_order_spec.rb +18 -31
- data/spec/features/admin/orders/order_details_spec.rb +22 -27
- data/spec/features/admin/orders/payments_spec.rb +5 -12
- data/spec/features/admin/orders/shipments_spec.rb +36 -2
- data/spec/features/admin/products/edit/images_spec.rb +1 -1
- data/spec/features/admin/products/edit/products_spec.rb +3 -3
- data/spec/features/admin/products/pricing_spec.rb +1 -1
- data/spec/features/admin/promotion_adjustments_spec.rb +42 -20
- data/spec/features/admin/stock_transfer_spec.rb +4 -4
- data/spec/features/admin/users_spec.rb +14 -0
- data/spec/javascripts/fixtures/_boot.html.erb +8 -0
- data/spec/javascripts/fixtures/number_with_currency/with_currency_select.html.erb +3 -0
- data/spec/javascripts/fixtures/number_with_currency/without_select.html.erb +3 -0
- data/spec/javascripts/format_money_spec.js +48 -0
- data/spec/javascripts/spec_helper.js +11 -0
- data/spec/javascripts/support/show_errors.js +8 -0
- data/spec/javascripts/support/with_translations.js +11 -0
- data/spec/javascripts/translation_spec.js +50 -0
- data/spec/javascripts/views/number_with_currency_spec.js +72 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/feature/order_feature_helper.rb +8 -0
- data/spec/teaspoon_env.rb +17 -0
- data/vendor/assets/images/solidus_admin/select2-spinner.gif +0 -0
- data/vendor/assets/images/solidus_admin/select2.png +0 -0
- data/vendor/assets/images/solidus_admin/select2x2.png +0 -0
- data/vendor/assets/javascripts/solidus_admin/accounting.js +4 -0
- data/vendor/assets/javascripts/solidus_admin/backbone-nested-models.js +193 -0
- data/vendor/assets/javascripts/solidus_admin/bootstrap.js +1775 -1800
- data/vendor/assets/javascripts/solidus_admin/select2.js +3729 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/index.js +1 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_ar.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_az.js +20 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_bg.js +20 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_ca.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_cs.js +51 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_da.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_de.js +18 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_el.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_es.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_et.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_eu.js +45 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_fa.js +21 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_fi.js +30 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_fr.js +18 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_gl.js +45 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_he.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_hr.js +24 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_hu.js +17 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_id.js +21 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_is.js +17 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_it.js +17 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_ja.js +17 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_ka.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_ko.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_lt.js +26 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_lv.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_mk.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_ms.js +21 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_nb.js +22 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_nl.js +17 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_pl.js +54 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_pt-BR.js +18 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_pt-PT.js +17 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_ro.js +17 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_rs.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_ru.js +23 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_sk.js +50 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_sv.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_th.js +19 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_tr.js +20 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_ug-CN.js +16 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_uk.js +25 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_vi.js +20 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_zh-CN.js +16 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_zh-TW.js +16 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_alert.scss +5 -15
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_badge.scss +77 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_breadcrumb.scss +25 -10
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_button-group.scss +38 -60
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_buttons.scss +27 -30
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_card.scss +66 -82
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_carousel.scss +99 -173
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_close.scss +6 -3
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_code.scss +13 -7
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_custom-forms.scss +151 -114
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_custom.scss +4 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_dropdown.scss +28 -60
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_forms.scss +154 -218
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_grid.scss +22 -46
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_images.scss +7 -17
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_input-group.scss +43 -54
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_list-group.scss +80 -79
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_media.scss +6 -84
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_mixins.scss +9 -7
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_modal.scss +38 -42
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_nav.scss +41 -84
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_navbar.scss +171 -133
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_normalize.scss +230 -197
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_pagination.scss +16 -22
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_popover.scss +87 -56
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_print.scss +96 -65
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_progress.scss +17 -141
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_reboot.scss +76 -34
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_responsive-embed.scss +18 -5
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_tables.scss +26 -66
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_tooltip.scss +23 -18
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_transitions.scss +34 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_type.scss +16 -30
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_utilities.scss +13 -95
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_variables.scss +542 -247
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-grid.scss +20 -39
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-reboot.scss +2 -2
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap.scss +6 -8
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_background-variant.scss +1 -2
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/{_label.scss → _badge.scss} +2 -2
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_breakpoints.scss +25 -16
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_buttons.scss +39 -53
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_cards.scss +11 -2
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_clearfix.scss +1 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_float.scss +9 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_forms.scss +11 -21
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_gradients.scss +5 -11
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid-framework.scss +39 -18
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid.scss +52 -27
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_hover.scss +10 -9
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_image.scss +6 -4
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_list-group.scss +3 -5
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_pagination.scss +2 -3
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_reset-text.scss +3 -4
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_screen-reader.scss +2 -2
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_text-emphasis.scss +1 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_text-hide.scss +1 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_transforms.scss +14 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_visibility.scss +5 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_align.scss +6 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/{_utilities-background.scss → utilities/_background.scss} +3 -8
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_borders.scss +37 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_clearfix.scss +3 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_display.scss +18 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_flex.scss +48 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_float.scss +9 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_position.scss +23 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_screenreaders.scss +11 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_sizing.scss +10 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_spacing.scss +43 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_text.scss +61 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/{_utilities-responsive.scss → utilities/_visibility.scss} +7 -1
- data/vendor/assets/stylesheets/solidus_admin/select2.scss +692 -0
- metadata +149 -48
- data/app/assets/javascripts/spree/backend/handlebars_extensions.coffee +0 -19
- data/app/assets/javascripts/spree/backend/line_items.js.coffee +0 -55
- data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +0 -62
- data/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.coffee +0 -4
- data/app/assets/javascripts/spree/backend/stock_movement.js.coffee +0 -21
- data/app/assets/javascripts/spree/backend/variant_management.js.coffee +0 -10
- data/app/assets/javascripts/spree/backend/zone.js.coffee +0 -43
- data/app/views/spree/admin/general_settings/edit.html.erb +0 -80
- data/app/views/spree/admin/shared/_translations.html.erb +0 -29
- data/app/views/spree/admin/stock_movements/_form.html.erb +0 -12
- data/app/views/spree/admin/stock_movements/new.html.erb +0 -15
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_animation.scss +0 -27
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_labels.scss +0 -77
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_pager.scss +0 -57
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_utilities-spacing.scss +0 -39
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-flex.scss +0 -8
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_center-block.scss +0 -7
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_progress.scss +0 -18
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_pulls.scss +0 -6
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_reset-filter.scss +0 -8
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_tab-focus.scss +0 -9
@@ -1,41 +1,41 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap v4.0.0-alpha.
|
3
|
-
* Copyright 2011-
|
2
|
+
* Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com)
|
3
|
+
* Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
4
4
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
5
5
|
*/
|
6
6
|
|
7
7
|
if (typeof jQuery === 'undefined') {
|
8
|
-
throw new Error('Bootstrap\'s JavaScript requires jQuery')
|
8
|
+
throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.')
|
9
9
|
}
|
10
10
|
|
11
11
|
+function ($) {
|
12
12
|
var version = $.fn.jquery.split(' ')[0].split('.')
|
13
|
-
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >=
|
14
|
-
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than
|
13
|
+
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {
|
14
|
+
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
|
15
15
|
}
|
16
16
|
}(jQuery);
|
17
17
|
|
18
18
|
|
19
|
-
+function (
|
19
|
+
+function () {
|
20
20
|
|
21
|
-
|
22
|
-
* --------------------------------------------------------------------------
|
23
|
-
* Bootstrap (v4.0.0-alpha.2): util.js
|
24
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
25
|
-
* --------------------------------------------------------------------------
|
26
|
-
*/
|
21
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
27
22
|
|
28
|
-
|
23
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
29
24
|
|
30
|
-
|
25
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
31
26
|
|
32
|
-
|
27
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
33
28
|
|
34
|
-
function
|
29
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
35
30
|
|
36
|
-
|
31
|
+
/**
|
32
|
+
* --------------------------------------------------------------------------
|
33
|
+
* Bootstrap (v4.0.0-alpha.6): util.js
|
34
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
35
|
+
* --------------------------------------------------------------------------
|
36
|
+
*/
|
37
37
|
|
38
|
-
var Util =
|
38
|
+
var Util = function ($) {
|
39
39
|
|
40
40
|
/**
|
41
41
|
* ------------------------------------------------------------------------
|
@@ -45,6 +45,8 @@ var Util = (function ($) {
|
|
45
45
|
|
46
46
|
var transition = false;
|
47
47
|
|
48
|
+
var MAX_UID = 1000000;
|
49
|
+
|
48
50
|
var TransitionEndEvent = {
|
49
51
|
WebkitTransition: 'webkitTransitionEnd',
|
50
52
|
MozTransition: 'transitionend',
|
@@ -54,7 +56,7 @@ var Util = (function ($) {
|
|
54
56
|
|
55
57
|
// shoutout AngusCroll (https://goo.gl/pxwQGp)
|
56
58
|
function toType(obj) {
|
57
|
-
return
|
59
|
+
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
|
58
60
|
}
|
59
61
|
|
60
62
|
function isElement(obj) {
|
@@ -67,8 +69,9 @@ var Util = (function ($) {
|
|
67
69
|
delegateType: transition.end,
|
68
70
|
handle: function handle(event) {
|
69
71
|
if ($(event.target).is(this)) {
|
70
|
-
return event.handleObj.handler.apply(this, arguments);
|
72
|
+
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
71
73
|
}
|
74
|
+
return undefined;
|
72
75
|
}
|
73
76
|
};
|
74
77
|
}
|
@@ -80,9 +83,11 @@ var Util = (function ($) {
|
|
80
83
|
|
81
84
|
var el = document.createElement('bootstrap');
|
82
85
|
|
83
|
-
for (var
|
84
|
-
if (el.style[
|
85
|
-
return {
|
86
|
+
for (var name in TransitionEndEvent) {
|
87
|
+
if (el.style[name] !== undefined) {
|
88
|
+
return {
|
89
|
+
end: TransitionEndEvent[name]
|
90
|
+
};
|
86
91
|
}
|
87
92
|
}
|
88
93
|
|
@@ -129,11 +134,11 @@ var Util = (function ($) {
|
|
129
134
|
|
130
135
|
getUID: function getUID(prefix) {
|
131
136
|
do {
|
132
|
-
|
137
|
+
// eslint-disable-next-line no-bitwise
|
138
|
+
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
|
133
139
|
} while (document.getElementById(prefix));
|
134
140
|
return prefix;
|
135
141
|
},
|
136
|
-
|
137
142
|
getSelectorFromElement: function getSelectorFromElement(element) {
|
138
143
|
var selector = element.getAttribute('data-target');
|
139
144
|
|
@@ -144,31 +149,21 @@ var Util = (function ($) {
|
|
144
149
|
|
145
150
|
return selector;
|
146
151
|
},
|
147
|
-
|
148
152
|
reflow: function reflow(element) {
|
149
|
-
|
153
|
+
return element.offsetHeight;
|
150
154
|
},
|
151
|
-
|
152
155
|
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
153
156
|
$(element).trigger(transition.end);
|
154
157
|
},
|
155
|
-
|
156
158
|
supportsTransitionEnd: function supportsTransitionEnd() {
|
157
159
|
return Boolean(transition);
|
158
160
|
},
|
159
|
-
|
160
161
|
typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
|
161
162
|
for (var property in configTypes) {
|
162
163
|
if (configTypes.hasOwnProperty(property)) {
|
163
164
|
var expectedTypes = configTypes[property];
|
164
165
|
var value = config[property];
|
165
|
-
var valueType =
|
166
|
-
|
167
|
-
if (value && isElement(value)) {
|
168
|
-
valueType = 'element';
|
169
|
-
} else {
|
170
|
-
valueType = toType(value);
|
171
|
-
}
|
166
|
+
var valueType = value && isElement(value) ? 'element' : toType(value);
|
172
167
|
|
173
168
|
if (!new RegExp(expectedTypes).test(valueType)) {
|
174
169
|
throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".'));
|
@@ -181,16 +176,16 @@ var Util = (function ($) {
|
|
181
176
|
setTransitionEndSupport();
|
182
177
|
|
183
178
|
return Util;
|
184
|
-
}
|
179
|
+
}(jQuery);
|
185
180
|
|
186
181
|
/**
|
187
182
|
* --------------------------------------------------------------------------
|
188
|
-
* Bootstrap (v4.0.0-alpha.
|
183
|
+
* Bootstrap (v4.0.0-alpha.6): alert.js
|
189
184
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
190
185
|
* --------------------------------------------------------------------------
|
191
186
|
*/
|
192
187
|
|
193
|
-
var Alert =
|
188
|
+
var Alert = function ($) {
|
194
189
|
|
195
190
|
/**
|
196
191
|
* ------------------------------------------------------------------------
|
@@ -199,7 +194,7 @@ var Alert = (function ($) {
|
|
199
194
|
*/
|
200
195
|
|
201
196
|
var NAME = 'alert';
|
202
|
-
var VERSION = '4.0.0-alpha';
|
197
|
+
var VERSION = '4.0.0-alpha.6';
|
203
198
|
var DATA_KEY = 'bs.alert';
|
204
199
|
var EVENT_KEY = '.' + DATA_KEY;
|
205
200
|
var DATA_API_KEY = '.data-api';
|
@@ -219,7 +214,7 @@ var Alert = (function ($) {
|
|
219
214
|
var ClassName = {
|
220
215
|
ALERT: 'alert',
|
221
216
|
FADE: 'fade',
|
222
|
-
|
217
|
+
SHOW: 'show'
|
223
218
|
};
|
224
219
|
|
225
220
|
/**
|
@@ -228,120 +223,107 @@ var Alert = (function ($) {
|
|
228
223
|
* ------------------------------------------------------------------------
|
229
224
|
*/
|
230
225
|
|
231
|
-
var Alert =
|
226
|
+
var Alert = function () {
|
232
227
|
function Alert(element) {
|
233
228
|
_classCallCheck(this, Alert);
|
234
229
|
|
235
230
|
this._element = element;
|
236
231
|
}
|
237
232
|
|
238
|
-
/**
|
239
|
-
* ------------------------------------------------------------------------
|
240
|
-
* Data Api implementation
|
241
|
-
* ------------------------------------------------------------------------
|
242
|
-
*/
|
243
|
-
|
244
233
|
// getters
|
245
234
|
|
246
|
-
|
247
|
-
|
235
|
+
// public
|
236
|
+
|
237
|
+
Alert.prototype.close = function close(element) {
|
238
|
+
element = element || this._element;
|
248
239
|
|
249
|
-
|
240
|
+
var rootElement = this._getRootElement(element);
|
241
|
+
var customEvent = this._triggerCloseEvent(rootElement);
|
250
242
|
|
251
|
-
|
252
|
-
|
243
|
+
if (customEvent.isDefaultPrevented()) {
|
244
|
+
return;
|
245
|
+
}
|
253
246
|
|
254
|
-
|
255
|
-
|
247
|
+
this._removeElement(rootElement);
|
248
|
+
};
|
256
249
|
|
257
|
-
|
258
|
-
|
259
|
-
|
250
|
+
Alert.prototype.dispose = function dispose() {
|
251
|
+
$.removeData(this._element, DATA_KEY);
|
252
|
+
this._element = null;
|
253
|
+
};
|
254
|
+
|
255
|
+
// private
|
256
|
+
|
257
|
+
Alert.prototype._getRootElement = function _getRootElement(element) {
|
258
|
+
var selector = Util.getSelectorFromElement(element);
|
259
|
+
var parent = false;
|
260
260
|
|
261
|
-
|
261
|
+
if (selector) {
|
262
|
+
parent = $(selector)[0];
|
262
263
|
}
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
$.removeData(this._element, DATA_KEY);
|
267
|
-
this._element = null;
|
264
|
+
|
265
|
+
if (!parent) {
|
266
|
+
parent = $(element).closest('.' + ClassName.ALERT)[0];
|
268
267
|
}
|
269
268
|
|
270
|
-
|
269
|
+
return parent;
|
270
|
+
};
|
271
271
|
|
272
|
-
|
273
|
-
|
274
|
-
value: function _getRootElement(element) {
|
275
|
-
var selector = Util.getSelectorFromElement(element);
|
276
|
-
var parent = false;
|
272
|
+
Alert.prototype._triggerCloseEvent = function _triggerCloseEvent(element) {
|
273
|
+
var closeEvent = $.Event(Event.CLOSE);
|
277
274
|
|
278
|
-
|
279
|
-
|
280
|
-
|
275
|
+
$(element).trigger(closeEvent);
|
276
|
+
return closeEvent;
|
277
|
+
};
|
281
278
|
|
282
|
-
|
283
|
-
|
284
|
-
}
|
279
|
+
Alert.prototype._removeElement = function _removeElement(element) {
|
280
|
+
var _this2 = this;
|
285
281
|
|
286
|
-
|
287
|
-
}
|
288
|
-
}, {
|
289
|
-
key: '_triggerCloseEvent',
|
290
|
-
value: function _triggerCloseEvent(element) {
|
291
|
-
var closeEvent = $.Event(Event.CLOSE);
|
282
|
+
$(element).removeClass(ClassName.SHOW);
|
292
283
|
|
293
|
-
|
294
|
-
|
284
|
+
if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
|
285
|
+
this._destroyElement(element);
|
286
|
+
return;
|
295
287
|
}
|
296
|
-
}, {
|
297
|
-
key: '_removeElement',
|
298
|
-
value: function _removeElement(element) {
|
299
|
-
$(element).removeClass(ClassName.IN);
|
300
288
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
289
|
+
$(element).one(Util.TRANSITION_END, function (event) {
|
290
|
+
return _this2._destroyElement(element, event);
|
291
|
+
}).emulateTransitionEnd(TRANSITION_DURATION);
|
292
|
+
};
|
305
293
|
|
306
|
-
|
307
|
-
|
308
|
-
}
|
309
|
-
key: '_destroyElement',
|
310
|
-
value: function _destroyElement(element) {
|
311
|
-
$(element).detach().trigger(Event.CLOSED).remove();
|
312
|
-
}
|
294
|
+
Alert.prototype._destroyElement = function _destroyElement(element) {
|
295
|
+
$(element).detach().trigger(Event.CLOSED).remove();
|
296
|
+
};
|
313
297
|
|
314
|
-
|
298
|
+
// static
|
315
299
|
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
var $element = $(this);
|
321
|
-
var data = $element.data(DATA_KEY);
|
300
|
+
Alert._jQueryInterface = function _jQueryInterface(config) {
|
301
|
+
return this.each(function () {
|
302
|
+
var $element = $(this);
|
303
|
+
var data = $element.data(DATA_KEY);
|
322
304
|
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
305
|
+
if (!data) {
|
306
|
+
data = new Alert(this);
|
307
|
+
$element.data(DATA_KEY, data);
|
308
|
+
}
|
327
309
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
}, {
|
334
|
-
key: '_handleDismiss',
|
335
|
-
value: function _handleDismiss(alertInstance) {
|
336
|
-
return function (event) {
|
337
|
-
if (event) {
|
338
|
-
event.preventDefault();
|
339
|
-
}
|
310
|
+
if (config === 'close') {
|
311
|
+
data[config](this);
|
312
|
+
}
|
313
|
+
});
|
314
|
+
};
|
340
315
|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
316
|
+
Alert._handleDismiss = function _handleDismiss(alertInstance) {
|
317
|
+
return function (event) {
|
318
|
+
if (event) {
|
319
|
+
event.preventDefault();
|
320
|
+
}
|
321
|
+
|
322
|
+
alertInstance.close(this);
|
323
|
+
};
|
324
|
+
};
|
325
|
+
|
326
|
+
_createClass(Alert, null, [{
|
345
327
|
key: 'VERSION',
|
346
328
|
get: function get() {
|
347
329
|
return VERSION;
|
@@ -349,7 +331,13 @@ var Alert = (function ($) {
|
|
349
331
|
}]);
|
350
332
|
|
351
333
|
return Alert;
|
352
|
-
}
|
334
|
+
}();
|
335
|
+
|
336
|
+
/**
|
337
|
+
* ------------------------------------------------------------------------
|
338
|
+
* Data Api implementation
|
339
|
+
* ------------------------------------------------------------------------
|
340
|
+
*/
|
353
341
|
|
354
342
|
$(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
|
355
343
|
|
@@ -367,16 +355,16 @@ var Alert = (function ($) {
|
|
367
355
|
};
|
368
356
|
|
369
357
|
return Alert;
|
370
|
-
}
|
358
|
+
}(jQuery);
|
371
359
|
|
372
360
|
/**
|
373
361
|
* --------------------------------------------------------------------------
|
374
|
-
* Bootstrap (v4.0.0-alpha.
|
362
|
+
* Bootstrap (v4.0.0-alpha.6): button.js
|
375
363
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
376
364
|
* --------------------------------------------------------------------------
|
377
365
|
*/
|
378
366
|
|
379
|
-
var Button =
|
367
|
+
var Button = function ($) {
|
380
368
|
|
381
369
|
/**
|
382
370
|
* ------------------------------------------------------------------------
|
@@ -385,7 +373,7 @@ var Button = (function ($) {
|
|
385
373
|
*/
|
386
374
|
|
387
375
|
var NAME = 'button';
|
388
|
-
var VERSION = '4.0.0-alpha';
|
376
|
+
var VERSION = '4.0.0-alpha.6';
|
389
377
|
var DATA_KEY = 'bs.button';
|
390
378
|
var EVENT_KEY = '.' + DATA_KEY;
|
391
379
|
var DATA_API_KEY = '.data-api';
|
@@ -416,85 +404,76 @@ var Button = (function ($) {
|
|
416
404
|
* ------------------------------------------------------------------------
|
417
405
|
*/
|
418
406
|
|
419
|
-
var Button =
|
407
|
+
var Button = function () {
|
420
408
|
function Button(element) {
|
421
409
|
_classCallCheck(this, Button);
|
422
410
|
|
423
411
|
this._element = element;
|
424
412
|
}
|
425
413
|
|
426
|
-
/**
|
427
|
-
* ------------------------------------------------------------------------
|
428
|
-
* Data Api implementation
|
429
|
-
* ------------------------------------------------------------------------
|
430
|
-
*/
|
431
|
-
|
432
414
|
// getters
|
433
415
|
|
434
|
-
|
435
|
-
key: 'toggle',
|
436
|
-
|
437
|
-
// public
|
416
|
+
// public
|
438
417
|
|
439
|
-
|
440
|
-
|
441
|
-
|
418
|
+
Button.prototype.toggle = function toggle() {
|
419
|
+
var triggerChangeEvent = true;
|
420
|
+
var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
|
442
421
|
|
443
|
-
|
444
|
-
|
422
|
+
if (rootElement) {
|
423
|
+
var input = $(this._element).find(Selector.INPUT)[0];
|
445
424
|
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
425
|
+
if (input) {
|
426
|
+
if (input.type === 'radio') {
|
427
|
+
if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
|
428
|
+
triggerChangeEvent = false;
|
429
|
+
} else {
|
430
|
+
var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
|
452
431
|
|
453
|
-
|
454
|
-
|
455
|
-
}
|
432
|
+
if (activeElement) {
|
433
|
+
$(activeElement).removeClass(ClassName.ACTIVE);
|
456
434
|
}
|
457
435
|
}
|
436
|
+
}
|
458
437
|
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
}
|
438
|
+
if (triggerChangeEvent) {
|
439
|
+
input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
|
440
|
+
$(input).trigger('change');
|
463
441
|
}
|
464
|
-
} else {
|
465
|
-
this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
|
466
|
-
}
|
467
442
|
|
468
|
-
|
469
|
-
$(this._element).toggleClass(ClassName.ACTIVE);
|
443
|
+
input.focus();
|
470
444
|
}
|
471
445
|
}
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
this._element
|
446
|
+
|
447
|
+
this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
|
448
|
+
|
449
|
+
if (triggerChangeEvent) {
|
450
|
+
$(this._element).toggleClass(ClassName.ACTIVE);
|
477
451
|
}
|
452
|
+
};
|
453
|
+
|
454
|
+
Button.prototype.dispose = function dispose() {
|
455
|
+
$.removeData(this._element, DATA_KEY);
|
456
|
+
this._element = null;
|
457
|
+
};
|
478
458
|
|
479
|
-
|
459
|
+
// static
|
480
460
|
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
return this.each(function () {
|
485
|
-
var data = $(this).data(DATA_KEY);
|
461
|
+
Button._jQueryInterface = function _jQueryInterface(config) {
|
462
|
+
return this.each(function () {
|
463
|
+
var data = $(this).data(DATA_KEY);
|
486
464
|
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
465
|
+
if (!data) {
|
466
|
+
data = new Button(this);
|
467
|
+
$(this).data(DATA_KEY, data);
|
468
|
+
}
|
491
469
|
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
470
|
+
if (config === 'toggle') {
|
471
|
+
data[config]();
|
472
|
+
}
|
473
|
+
});
|
474
|
+
};
|
475
|
+
|
476
|
+
_createClass(Button, null, [{
|
498
477
|
key: 'VERSION',
|
499
478
|
get: function get() {
|
500
479
|
return VERSION;
|
@@ -502,7 +481,13 @@ var Button = (function ($) {
|
|
502
481
|
}]);
|
503
482
|
|
504
483
|
return Button;
|
505
|
-
}
|
484
|
+
}();
|
485
|
+
|
486
|
+
/**
|
487
|
+
* ------------------------------------------------------------------------
|
488
|
+
* Data Api implementation
|
489
|
+
* ------------------------------------------------------------------------
|
490
|
+
*/
|
506
491
|
|
507
492
|
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
508
493
|
event.preventDefault();
|
@@ -533,16 +518,16 @@ var Button = (function ($) {
|
|
533
518
|
};
|
534
519
|
|
535
520
|
return Button;
|
536
|
-
}
|
521
|
+
}(jQuery);
|
537
522
|
|
538
523
|
/**
|
539
524
|
* --------------------------------------------------------------------------
|
540
|
-
* Bootstrap (v4.0.0-alpha.
|
525
|
+
* Bootstrap (v4.0.0-alpha.6): carousel.js
|
541
526
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
542
527
|
* --------------------------------------------------------------------------
|
543
528
|
*/
|
544
529
|
|
545
|
-
var Carousel =
|
530
|
+
var Carousel = function ($) {
|
546
531
|
|
547
532
|
/**
|
548
533
|
* ------------------------------------------------------------------------
|
@@ -551,12 +536,14 @@ var Carousel = (function ($) {
|
|
551
536
|
*/
|
552
537
|
|
553
538
|
var NAME = 'carousel';
|
554
|
-
var VERSION = '4.0.0-alpha';
|
539
|
+
var VERSION = '4.0.0-alpha.6';
|
555
540
|
var DATA_KEY = 'bs.carousel';
|
556
541
|
var EVENT_KEY = '.' + DATA_KEY;
|
557
542
|
var DATA_API_KEY = '.data-api';
|
558
543
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
559
544
|
var TRANSITION_DURATION = 600;
|
545
|
+
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
|
546
|
+
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
|
560
547
|
|
561
548
|
var Default = {
|
562
549
|
interval: 5000,
|
@@ -576,7 +563,9 @@ var Carousel = (function ($) {
|
|
576
563
|
|
577
564
|
var Direction = {
|
578
565
|
NEXT: 'next',
|
579
|
-
|
566
|
+
PREV: 'prev',
|
567
|
+
LEFT: 'left',
|
568
|
+
RIGHT: 'right'
|
580
569
|
};
|
581
570
|
|
582
571
|
var Event = {
|
@@ -593,8 +582,10 @@ var Carousel = (function ($) {
|
|
593
582
|
CAROUSEL: 'carousel',
|
594
583
|
ACTIVE: 'active',
|
595
584
|
SLIDE: 'slide',
|
596
|
-
RIGHT: 'right',
|
597
|
-
LEFT: 'left',
|
585
|
+
RIGHT: 'carousel-item-right',
|
586
|
+
LEFT: 'carousel-item-left',
|
587
|
+
NEXT: 'carousel-item-next',
|
588
|
+
PREV: 'carousel-item-prev',
|
598
589
|
ITEM: 'carousel-item'
|
599
590
|
};
|
600
591
|
|
@@ -602,7 +593,7 @@ var Carousel = (function ($) {
|
|
602
593
|
ACTIVE: '.active',
|
603
594
|
ACTIVE_ITEM: '.active.carousel-item',
|
604
595
|
ITEM: '.carousel-item',
|
605
|
-
NEXT_PREV: '.next, .prev',
|
596
|
+
NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
|
606
597
|
INDICATORS: '.carousel-indicators',
|
607
598
|
DATA_SLIDE: '[data-slide], [data-slide-to]',
|
608
599
|
DATA_RIDE: '[data-ride="carousel"]'
|
@@ -614,7 +605,7 @@ var Carousel = (function ($) {
|
|
614
605
|
* ------------------------------------------------------------------------
|
615
606
|
*/
|
616
607
|
|
617
|
-
var Carousel =
|
608
|
+
var Carousel = function () {
|
618
609
|
function Carousel(element, config) {
|
619
610
|
_classCallCheck(this, Carousel);
|
620
611
|
|
@@ -632,342 +623,338 @@ var Carousel = (function ($) {
|
|
632
623
|
this._addEventListeners();
|
633
624
|
}
|
634
625
|
|
635
|
-
/**
|
636
|
-
* ------------------------------------------------------------------------
|
637
|
-
* Data Api implementation
|
638
|
-
* ------------------------------------------------------------------------
|
639
|
-
*/
|
640
|
-
|
641
626
|
// getters
|
642
627
|
|
643
|
-
|
644
|
-
key: 'next',
|
628
|
+
// public
|
645
629
|
|
646
|
-
|
630
|
+
Carousel.prototype.next = function next() {
|
631
|
+
if (this._isSliding) {
|
632
|
+
throw new Error('Carousel is sliding');
|
633
|
+
}
|
634
|
+
this._slide(Direction.NEXT);
|
635
|
+
};
|
647
636
|
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
637
|
+
Carousel.prototype.nextWhenVisible = function nextWhenVisible() {
|
638
|
+
// Don't call next when the page isn't visible
|
639
|
+
if (!document.hidden) {
|
640
|
+
this.next();
|
652
641
|
}
|
653
|
-
}
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
this.next();
|
659
|
-
}
|
642
|
+
};
|
643
|
+
|
644
|
+
Carousel.prototype.prev = function prev() {
|
645
|
+
if (this._isSliding) {
|
646
|
+
throw new Error('Carousel is sliding');
|
660
647
|
}
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
648
|
+
this._slide(Direction.PREVIOUS);
|
649
|
+
};
|
650
|
+
|
651
|
+
Carousel.prototype.pause = function pause(event) {
|
652
|
+
if (!event) {
|
653
|
+
this._isPaused = true;
|
667
654
|
}
|
668
|
-
}, {
|
669
|
-
key: 'pause',
|
670
|
-
value: function pause(event) {
|
671
|
-
if (!event) {
|
672
|
-
this._isPaused = true;
|
673
|
-
}
|
674
655
|
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
656
|
+
if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
|
657
|
+
Util.triggerTransitionEnd(this._element);
|
658
|
+
this.cycle(true);
|
659
|
+
}
|
660
|
+
|
661
|
+
clearInterval(this._interval);
|
662
|
+
this._interval = null;
|
663
|
+
};
|
664
|
+
|
665
|
+
Carousel.prototype.cycle = function cycle(event) {
|
666
|
+
if (!event) {
|
667
|
+
this._isPaused = false;
|
668
|
+
}
|
679
669
|
|
670
|
+
if (this._interval) {
|
680
671
|
clearInterval(this._interval);
|
681
672
|
this._interval = null;
|
682
673
|
}
|
683
|
-
}, {
|
684
|
-
key: 'cycle',
|
685
|
-
value: function cycle(event) {
|
686
|
-
if (!event) {
|
687
|
-
this._isPaused = false;
|
688
|
-
}
|
689
674
|
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
675
|
+
if (this._config.interval && !this._isPaused) {
|
676
|
+
this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
|
677
|
+
}
|
678
|
+
};
|
694
679
|
|
695
|
-
|
696
|
-
|
697
|
-
|
680
|
+
Carousel.prototype.to = function to(index) {
|
681
|
+
var _this3 = this;
|
682
|
+
|
683
|
+
this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
|
684
|
+
|
685
|
+
var activeIndex = this._getItemIndex(this._activeElement);
|
686
|
+
|
687
|
+
if (index > this._items.length - 1 || index < 0) {
|
688
|
+
return;
|
698
689
|
}
|
699
|
-
}, {
|
700
|
-
key: 'to',
|
701
|
-
value: function to(index) {
|
702
|
-
var _this2 = this;
|
703
690
|
|
704
|
-
|
691
|
+
if (this._isSliding) {
|
692
|
+
$(this._element).one(Event.SLID, function () {
|
693
|
+
return _this3.to(index);
|
694
|
+
});
|
695
|
+
return;
|
696
|
+
}
|
705
697
|
|
706
|
-
|
698
|
+
if (activeIndex === index) {
|
699
|
+
this.pause();
|
700
|
+
this.cycle();
|
701
|
+
return;
|
702
|
+
}
|
707
703
|
|
708
|
-
|
709
|
-
return;
|
710
|
-
}
|
704
|
+
var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
|
711
705
|
|
712
|
-
|
713
|
-
|
714
|
-
return _this2.to(index);
|
715
|
-
});
|
716
|
-
return;
|
717
|
-
}
|
706
|
+
this._slide(direction, this._items[index]);
|
707
|
+
};
|
718
708
|
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
return;
|
723
|
-
}
|
709
|
+
Carousel.prototype.dispose = function dispose() {
|
710
|
+
$(this._element).off(EVENT_KEY);
|
711
|
+
$.removeData(this._element, DATA_KEY);
|
724
712
|
|
725
|
-
|
713
|
+
this._items = null;
|
714
|
+
this._config = null;
|
715
|
+
this._element = null;
|
716
|
+
this._interval = null;
|
717
|
+
this._isPaused = null;
|
718
|
+
this._isSliding = null;
|
719
|
+
this._activeElement = null;
|
720
|
+
this._indicatorsElement = null;
|
721
|
+
};
|
726
722
|
|
727
|
-
|
728
|
-
}
|
729
|
-
}, {
|
730
|
-
key: 'dispose',
|
731
|
-
value: function dispose() {
|
732
|
-
$(this._element).off(EVENT_KEY);
|
733
|
-
$.removeData(this._element, DATA_KEY);
|
734
|
-
|
735
|
-
this._items = null;
|
736
|
-
this._config = null;
|
737
|
-
this._element = null;
|
738
|
-
this._interval = null;
|
739
|
-
this._isPaused = null;
|
740
|
-
this._isSliding = null;
|
741
|
-
this._activeElement = null;
|
742
|
-
this._indicatorsElement = null;
|
743
|
-
}
|
723
|
+
// private
|
744
724
|
|
745
|
-
|
725
|
+
Carousel.prototype._getConfig = function _getConfig(config) {
|
726
|
+
config = $.extend({}, Default, config);
|
727
|
+
Util.typeCheckConfig(NAME, config, DefaultType);
|
728
|
+
return config;
|
729
|
+
};
|
746
730
|
|
747
|
-
|
748
|
-
|
749
|
-
value: function _getConfig(config) {
|
750
|
-
config = $.extend({}, Default, config);
|
751
|
-
Util.typeCheckConfig(NAME, config, DefaultType);
|
752
|
-
return config;
|
753
|
-
}
|
754
|
-
}, {
|
755
|
-
key: '_addEventListeners',
|
756
|
-
value: function _addEventListeners() {
|
757
|
-
if (this._config.keyboard) {
|
758
|
-
$(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this));
|
759
|
-
}
|
731
|
+
Carousel.prototype._addEventListeners = function _addEventListeners() {
|
732
|
+
var _this4 = this;
|
760
733
|
|
761
|
-
|
762
|
-
|
763
|
-
|
734
|
+
if (this._config.keyboard) {
|
735
|
+
$(this._element).on(Event.KEYDOWN, function (event) {
|
736
|
+
return _this4._keydown(event);
|
737
|
+
});
|
764
738
|
}
|
765
|
-
}, {
|
766
|
-
key: '_keydown',
|
767
|
-
value: function _keydown(event) {
|
768
|
-
event.preventDefault();
|
769
739
|
|
770
|
-
|
771
|
-
|
772
|
-
|
740
|
+
if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
|
741
|
+
$(this._element).on(Event.MOUSEENTER, function (event) {
|
742
|
+
return _this4.pause(event);
|
743
|
+
}).on(Event.MOUSELEAVE, function (event) {
|
744
|
+
return _this4.cycle(event);
|
745
|
+
});
|
746
|
+
}
|
747
|
+
};
|
773
748
|
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
case 39:
|
778
|
-
this.next();break;
|
779
|
-
default:
|
780
|
-
return;
|
781
|
-
}
|
749
|
+
Carousel.prototype._keydown = function _keydown(event) {
|
750
|
+
if (/input|textarea/i.test(event.target.tagName)) {
|
751
|
+
return;
|
782
752
|
}
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
753
|
+
|
754
|
+
switch (event.which) {
|
755
|
+
case ARROW_LEFT_KEYCODE:
|
756
|
+
event.preventDefault();
|
757
|
+
this.prev();
|
758
|
+
break;
|
759
|
+
case ARROW_RIGHT_KEYCODE:
|
760
|
+
event.preventDefault();
|
761
|
+
this.next();
|
762
|
+
break;
|
763
|
+
default:
|
764
|
+
return;
|
788
765
|
}
|
789
|
-
}
|
790
|
-
key: '_getItemByDirection',
|
791
|
-
value: function _getItemByDirection(direction, activeElement) {
|
792
|
-
var isNextDirection = direction === Direction.NEXT;
|
793
|
-
var isPrevDirection = direction === Direction.PREVIOUS;
|
794
|
-
var activeIndex = this._getItemIndex(activeElement);
|
795
|
-
var lastItemIndex = this._items.length - 1;
|
796
|
-
var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
|
766
|
+
};
|
797
767
|
|
798
|
-
|
799
|
-
|
800
|
-
|
768
|
+
Carousel.prototype._getItemIndex = function _getItemIndex(element) {
|
769
|
+
this._items = $.makeArray($(element).parent().find(Selector.ITEM));
|
770
|
+
return this._items.indexOf(element);
|
771
|
+
};
|
801
772
|
|
802
|
-
|
803
|
-
|
773
|
+
Carousel.prototype._getItemByDirection = function _getItemByDirection(direction, activeElement) {
|
774
|
+
var isNextDirection = direction === Direction.NEXT;
|
775
|
+
var isPrevDirection = direction === Direction.PREVIOUS;
|
776
|
+
var activeIndex = this._getItemIndex(activeElement);
|
777
|
+
var lastItemIndex = this._items.length - 1;
|
778
|
+
var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
|
804
779
|
|
805
|
-
|
780
|
+
if (isGoingToWrap && !this._config.wrap) {
|
781
|
+
return activeElement;
|
806
782
|
}
|
807
|
-
}, {
|
808
|
-
key: '_triggerSlideEvent',
|
809
|
-
value: function _triggerSlideEvent(relatedTarget, directionalClassname) {
|
810
|
-
var slideEvent = $.Event(Event.SLIDE, {
|
811
|
-
relatedTarget: relatedTarget,
|
812
|
-
direction: directionalClassname
|
813
|
-
});
|
814
783
|
|
815
|
-
|
784
|
+
var delta = direction === Direction.PREVIOUS ? -1 : 1;
|
785
|
+
var itemIndex = (activeIndex + delta) % this._items.length;
|
816
786
|
|
817
|
-
|
818
|
-
|
819
|
-
}, {
|
820
|
-
key: '_setActiveIndicatorElement',
|
821
|
-
value: function _setActiveIndicatorElement(element) {
|
822
|
-
if (this._indicatorsElement) {
|
823
|
-
$(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
|
787
|
+
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
788
|
+
};
|
824
789
|
|
825
|
-
|
790
|
+
Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
|
791
|
+
var slideEvent = $.Event(Event.SLIDE, {
|
792
|
+
relatedTarget: relatedTarget,
|
793
|
+
direction: eventDirectionName
|
794
|
+
});
|
826
795
|
|
827
|
-
|
828
|
-
|
829
|
-
|
796
|
+
$(this._element).trigger(slideEvent);
|
797
|
+
|
798
|
+
return slideEvent;
|
799
|
+
};
|
800
|
+
|
801
|
+
Carousel.prototype._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
|
802
|
+
if (this._indicatorsElement) {
|
803
|
+
$(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
|
804
|
+
|
805
|
+
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
806
|
+
|
807
|
+
if (nextIndicator) {
|
808
|
+
$(nextIndicator).addClass(ClassName.ACTIVE);
|
830
809
|
}
|
831
810
|
}
|
832
|
-
}
|
833
|
-
key: '_slide',
|
834
|
-
value: function _slide(direction, element) {
|
835
|
-
var _this3 = this;
|
811
|
+
};
|
836
812
|
|
837
|
-
|
838
|
-
|
813
|
+
Carousel.prototype._slide = function _slide(direction, element) {
|
814
|
+
var _this5 = this;
|
839
815
|
|
840
|
-
|
816
|
+
var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
|
817
|
+
var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
|
841
818
|
|
842
|
-
|
819
|
+
var isCycling = Boolean(this._interval);
|
843
820
|
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
}
|
821
|
+
var directionalClassName = void 0;
|
822
|
+
var orderClassName = void 0;
|
823
|
+
var eventDirectionName = void 0;
|
848
824
|
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
825
|
+
if (direction === Direction.NEXT) {
|
826
|
+
directionalClassName = ClassName.LEFT;
|
827
|
+
orderClassName = ClassName.NEXT;
|
828
|
+
eventDirectionName = Direction.LEFT;
|
829
|
+
} else {
|
830
|
+
directionalClassName = ClassName.RIGHT;
|
831
|
+
orderClassName = ClassName.PREV;
|
832
|
+
eventDirectionName = Direction.RIGHT;
|
833
|
+
}
|
853
834
|
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
835
|
+
if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
|
836
|
+
this._isSliding = false;
|
837
|
+
return;
|
838
|
+
}
|
858
839
|
|
859
|
-
|
840
|
+
var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
|
841
|
+
if (slideEvent.isDefaultPrevented()) {
|
842
|
+
return;
|
843
|
+
}
|
860
844
|
|
861
|
-
|
862
|
-
|
863
|
-
|
845
|
+
if (!activeElement || !nextElement) {
|
846
|
+
// some weirdness is happening, so we bail
|
847
|
+
return;
|
848
|
+
}
|
864
849
|
|
865
|
-
|
850
|
+
this._isSliding = true;
|
866
851
|
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
});
|
852
|
+
if (isCycling) {
|
853
|
+
this.pause();
|
854
|
+
}
|
871
855
|
|
872
|
-
|
856
|
+
this._setActiveIndicatorElement(nextElement);
|
873
857
|
|
874
|
-
|
858
|
+
var slidEvent = $.Event(Event.SLID, {
|
859
|
+
relatedTarget: nextElement,
|
860
|
+
direction: eventDirectionName
|
861
|
+
});
|
875
862
|
|
876
|
-
|
863
|
+
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
|
877
864
|
|
878
|
-
|
879
|
-
$(nextElement).addClass(directionalClassName);
|
865
|
+
$(nextElement).addClass(orderClassName);
|
880
866
|
|
881
|
-
|
882
|
-
$(nextElement).removeClass(directionalClassName).removeClass(direction);
|
867
|
+
Util.reflow(nextElement);
|
883
868
|
|
884
|
-
|
869
|
+
$(activeElement).addClass(directionalClassName);
|
870
|
+
$(nextElement).addClass(directionalClassName);
|
885
871
|
|
886
|
-
|
872
|
+
$(activeElement).one(Util.TRANSITION_END, function () {
|
873
|
+
$(nextElement).removeClass(directionalClassName + ' ' + orderClassName).addClass(ClassName.ACTIVE);
|
887
874
|
|
888
|
-
|
875
|
+
$(activeElement).removeClass(ClassName.ACTIVE + ' ' + orderClassName + ' ' + directionalClassName);
|
889
876
|
|
890
|
-
|
891
|
-
return $(_this3._element).trigger(slidEvent);
|
892
|
-
}, 0);
|
893
|
-
}).emulateTransitionEnd(TRANSITION_DURATION);
|
894
|
-
} else {
|
895
|
-
$(activeElement).removeClass(ClassName.ACTIVE);
|
896
|
-
$(nextElement).addClass(ClassName.ACTIVE);
|
877
|
+
_this5._isSliding = false;
|
897
878
|
|
898
|
-
|
899
|
-
|
900
|
-
|
879
|
+
setTimeout(function () {
|
880
|
+
return $(_this5._element).trigger(slidEvent);
|
881
|
+
}, 0);
|
882
|
+
}).emulateTransitionEnd(TRANSITION_DURATION);
|
883
|
+
} else {
|
884
|
+
$(activeElement).removeClass(ClassName.ACTIVE);
|
885
|
+
$(nextElement).addClass(ClassName.ACTIVE);
|
901
886
|
|
902
|
-
|
903
|
-
|
904
|
-
|
887
|
+
this._isSliding = false;
|
888
|
+
$(this._element).trigger(slidEvent);
|
889
|
+
}
|
890
|
+
|
891
|
+
if (isCycling) {
|
892
|
+
this.cycle();
|
905
893
|
}
|
894
|
+
};
|
906
895
|
|
907
|
-
|
896
|
+
// static
|
908
897
|
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
var data = $(this).data(DATA_KEY);
|
914
|
-
var _config = $.extend({}, Default, $(this).data());
|
898
|
+
Carousel._jQueryInterface = function _jQueryInterface(config) {
|
899
|
+
return this.each(function () {
|
900
|
+
var data = $(this).data(DATA_KEY);
|
901
|
+
var _config = $.extend({}, Default, $(this).data());
|
915
902
|
|
916
|
-
|
917
|
-
|
918
|
-
|
903
|
+
if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') {
|
904
|
+
$.extend(_config, config);
|
905
|
+
}
|
919
906
|
|
920
|
-
|
907
|
+
var action = typeof config === 'string' ? config : _config.slide;
|
921
908
|
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
909
|
+
if (!data) {
|
910
|
+
data = new Carousel(this, _config);
|
911
|
+
$(this).data(DATA_KEY, data);
|
912
|
+
}
|
926
913
|
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
}
|
933
|
-
data[action]();
|
934
|
-
} else if (_config.interval) {
|
935
|
-
data.pause();
|
936
|
-
data.cycle();
|
914
|
+
if (typeof config === 'number') {
|
915
|
+
data.to(config);
|
916
|
+
} else if (typeof action === 'string') {
|
917
|
+
if (data[action] === undefined) {
|
918
|
+
throw new Error('No method named "' + action + '"');
|
937
919
|
}
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
value: function _dataApiClickHandler(event) {
|
943
|
-
var selector = Util.getSelectorFromElement(this);
|
944
|
-
|
945
|
-
if (!selector) {
|
946
|
-
return;
|
920
|
+
data[action]();
|
921
|
+
} else if (_config.interval) {
|
922
|
+
data.pause();
|
923
|
+
data.cycle();
|
947
924
|
}
|
925
|
+
});
|
926
|
+
};
|
948
927
|
|
949
|
-
|
928
|
+
Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
|
929
|
+
var selector = Util.getSelectorFromElement(this);
|
950
930
|
|
951
|
-
|
952
|
-
|
953
|
-
|
931
|
+
if (!selector) {
|
932
|
+
return;
|
933
|
+
}
|
954
934
|
|
955
|
-
|
956
|
-
var slideIndex = this.getAttribute('data-slide-to');
|
935
|
+
var target = $(selector)[0];
|
957
936
|
|
958
|
-
|
959
|
-
|
960
|
-
|
937
|
+
if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
|
938
|
+
return;
|
939
|
+
}
|
961
940
|
|
962
|
-
|
941
|
+
var config = $.extend({}, $(target).data(), $(this).data());
|
942
|
+
var slideIndex = this.getAttribute('data-slide-to');
|
963
943
|
|
964
|
-
|
965
|
-
|
966
|
-
|
944
|
+
if (slideIndex) {
|
945
|
+
config.interval = false;
|
946
|
+
}
|
967
947
|
|
968
|
-
|
948
|
+
Carousel._jQueryInterface.call($(target), config);
|
949
|
+
|
950
|
+
if (slideIndex) {
|
951
|
+
$(target).data(DATA_KEY).to(slideIndex);
|
969
952
|
}
|
970
|
-
|
953
|
+
|
954
|
+
event.preventDefault();
|
955
|
+
};
|
956
|
+
|
957
|
+
_createClass(Carousel, null, [{
|
971
958
|
key: 'VERSION',
|
972
959
|
get: function get() {
|
973
960
|
return VERSION;
|
@@ -980,9 +967,15 @@ var Carousel = (function ($) {
|
|
980
967
|
}]);
|
981
968
|
|
982
969
|
return Carousel;
|
983
|
-
}
|
970
|
+
}();
|
984
971
|
|
985
|
-
|
972
|
+
/**
|
973
|
+
* ------------------------------------------------------------------------
|
974
|
+
* Data Api implementation
|
975
|
+
* ------------------------------------------------------------------------
|
976
|
+
*/
|
977
|
+
|
978
|
+
$(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
|
986
979
|
|
987
980
|
$(window).on(Event.LOAD_DATA_API, function () {
|
988
981
|
$(Selector.DATA_RIDE).each(function () {
|
@@ -1005,16 +998,16 @@ var Carousel = (function ($) {
|
|
1005
998
|
};
|
1006
999
|
|
1007
1000
|
return Carousel;
|
1008
|
-
}
|
1001
|
+
}(jQuery);
|
1009
1002
|
|
1010
1003
|
/**
|
1011
1004
|
* --------------------------------------------------------------------------
|
1012
|
-
* Bootstrap (v4.0.0-alpha.
|
1005
|
+
* Bootstrap (v4.0.0-alpha.6): collapse.js
|
1013
1006
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1014
1007
|
* --------------------------------------------------------------------------
|
1015
1008
|
*/
|
1016
1009
|
|
1017
|
-
var Collapse =
|
1010
|
+
var Collapse = function ($) {
|
1018
1011
|
|
1019
1012
|
/**
|
1020
1013
|
* ------------------------------------------------------------------------
|
@@ -1023,7 +1016,7 @@ var Collapse = (function ($) {
|
|
1023
1016
|
*/
|
1024
1017
|
|
1025
1018
|
var NAME = 'collapse';
|
1026
|
-
var VERSION = '4.0.0-alpha';
|
1019
|
+
var VERSION = '4.0.0-alpha.6';
|
1027
1020
|
var DATA_KEY = 'bs.collapse';
|
1028
1021
|
var EVENT_KEY = '.' + DATA_KEY;
|
1029
1022
|
var DATA_API_KEY = '.data-api';
|
@@ -1049,7 +1042,7 @@ var Collapse = (function ($) {
|
|
1049
1042
|
};
|
1050
1043
|
|
1051
1044
|
var ClassName = {
|
1052
|
-
|
1045
|
+
SHOW: 'show',
|
1053
1046
|
COLLAPSE: 'collapse',
|
1054
1047
|
COLLAPSING: 'collapsing',
|
1055
1048
|
COLLAPSED: 'collapsed'
|
@@ -1061,7 +1054,7 @@ var Collapse = (function ($) {
|
|
1061
1054
|
};
|
1062
1055
|
|
1063
1056
|
var Selector = {
|
1064
|
-
ACTIVES: '.
|
1057
|
+
ACTIVES: '.card > .show, .card > .collapsing',
|
1065
1058
|
DATA_TOGGLE: '[data-toggle="collapse"]'
|
1066
1059
|
};
|
1067
1060
|
|
@@ -1071,7 +1064,7 @@ var Collapse = (function ($) {
|
|
1071
1064
|
* ------------------------------------------------------------------------
|
1072
1065
|
*/
|
1073
1066
|
|
1074
|
-
var Collapse =
|
1067
|
+
var Collapse = function () {
|
1075
1068
|
function Collapse(element, config) {
|
1076
1069
|
_classCallCheck(this, Collapse);
|
1077
1070
|
|
@@ -1091,240 +1084,228 @@ var Collapse = (function ($) {
|
|
1091
1084
|
}
|
1092
1085
|
}
|
1093
1086
|
|
1094
|
-
/**
|
1095
|
-
* ------------------------------------------------------------------------
|
1096
|
-
* Data Api implementation
|
1097
|
-
* ------------------------------------------------------------------------
|
1098
|
-
*/
|
1099
|
-
|
1100
1087
|
// getters
|
1101
1088
|
|
1102
|
-
|
1103
|
-
key: 'toggle',
|
1089
|
+
// public
|
1104
1090
|
|
1105
|
-
|
1091
|
+
Collapse.prototype.toggle = function toggle() {
|
1092
|
+
if ($(this._element).hasClass(ClassName.SHOW)) {
|
1093
|
+
this.hide();
|
1094
|
+
} else {
|
1095
|
+
this.show();
|
1096
|
+
}
|
1097
|
+
};
|
1106
1098
|
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1099
|
+
Collapse.prototype.show = function show() {
|
1100
|
+
var _this6 = this;
|
1101
|
+
|
1102
|
+
if (this._isTransitioning) {
|
1103
|
+
throw new Error('Collapse is transitioning');
|
1104
|
+
}
|
1105
|
+
|
1106
|
+
if ($(this._element).hasClass(ClassName.SHOW)) {
|
1107
|
+
return;
|
1108
|
+
}
|
1109
|
+
|
1110
|
+
var actives = void 0;
|
1111
|
+
var activesData = void 0;
|
1112
|
+
|
1113
|
+
if (this._parent) {
|
1114
|
+
actives = $.makeArray($(this._parent).find(Selector.ACTIVES));
|
1115
|
+
if (!actives.length) {
|
1116
|
+
actives = null;
|
1112
1117
|
}
|
1113
1118
|
}
|
1114
|
-
}, {
|
1115
|
-
key: 'show',
|
1116
|
-
value: function show() {
|
1117
|
-
var _this4 = this;
|
1118
1119
|
|
1119
|
-
|
1120
|
+
if (actives) {
|
1121
|
+
activesData = $(actives).data(DATA_KEY);
|
1122
|
+
if (activesData && activesData._isTransitioning) {
|
1120
1123
|
return;
|
1121
1124
|
}
|
1125
|
+
}
|
1122
1126
|
|
1123
|
-
|
1124
|
-
|
1127
|
+
var startEvent = $.Event(Event.SHOW);
|
1128
|
+
$(this._element).trigger(startEvent);
|
1129
|
+
if (startEvent.isDefaultPrevented()) {
|
1130
|
+
return;
|
1131
|
+
}
|
1125
1132
|
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
}
|
1133
|
+
if (actives) {
|
1134
|
+
Collapse._jQueryInterface.call($(actives), 'hide');
|
1135
|
+
if (!activesData) {
|
1136
|
+
$(actives).data(DATA_KEY, null);
|
1131
1137
|
}
|
1138
|
+
}
|
1132
1139
|
|
1133
|
-
|
1134
|
-
activesData = $(actives).data(DATA_KEY);
|
1135
|
-
if (activesData && activesData._isTransitioning) {
|
1136
|
-
return;
|
1137
|
-
}
|
1138
|
-
}
|
1140
|
+
var dimension = this._getDimension();
|
1139
1141
|
|
1140
|
-
|
1141
|
-
$(this._element).trigger(startEvent);
|
1142
|
-
if (startEvent.isDefaultPrevented()) {
|
1143
|
-
return;
|
1144
|
-
}
|
1142
|
+
$(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
|
1145
1143
|
|
1146
|
-
|
1147
|
-
|
1148
|
-
if (!activesData) {
|
1149
|
-
$(actives).data(DATA_KEY, null);
|
1150
|
-
}
|
1151
|
-
}
|
1144
|
+
this._element.style[dimension] = 0;
|
1145
|
+
this._element.setAttribute('aria-expanded', true);
|
1152
1146
|
|
1153
|
-
|
1147
|
+
if (this._triggerArray.length) {
|
1148
|
+
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
|
1149
|
+
}
|
1154
1150
|
|
1155
|
-
|
1151
|
+
this.setTransitioning(true);
|
1156
1152
|
|
1157
|
-
|
1158
|
-
|
1153
|
+
var complete = function complete() {
|
1154
|
+
$(_this6._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
|
1159
1155
|
|
1160
|
-
|
1161
|
-
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
|
1162
|
-
}
|
1156
|
+
_this6._element.style[dimension] = '';
|
1163
1157
|
|
1164
|
-
|
1158
|
+
_this6.setTransitioning(false);
|
1165
1159
|
|
1166
|
-
|
1167
|
-
|
1160
|
+
$(_this6._element).trigger(Event.SHOWN);
|
1161
|
+
};
|
1168
1162
|
|
1169
|
-
|
1163
|
+
if (!Util.supportsTransitionEnd()) {
|
1164
|
+
complete();
|
1165
|
+
return;
|
1166
|
+
}
|
1170
1167
|
|
1171
|
-
|
1168
|
+
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
1169
|
+
var scrollSize = 'scroll' + capitalizedDimension;
|
1172
1170
|
|
1173
|
-
|
1174
|
-
};
|
1171
|
+
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
1175
1172
|
|
1176
|
-
|
1177
|
-
|
1178
|
-
return;
|
1179
|
-
}
|
1173
|
+
this._element.style[dimension] = this._element[scrollSize] + 'px';
|
1174
|
+
};
|
1180
1175
|
|
1181
|
-
|
1182
|
-
|
1176
|
+
Collapse.prototype.hide = function hide() {
|
1177
|
+
var _this7 = this;
|
1183
1178
|
|
1184
|
-
|
1179
|
+
if (this._isTransitioning) {
|
1180
|
+
throw new Error('Collapse is transitioning');
|
1181
|
+
}
|
1185
1182
|
|
1186
|
-
|
1183
|
+
if (!$(this._element).hasClass(ClassName.SHOW)) {
|
1184
|
+
return;
|
1187
1185
|
}
|
1188
|
-
}, {
|
1189
|
-
key: 'hide',
|
1190
|
-
value: function hide() {
|
1191
|
-
var _this5 = this;
|
1192
1186
|
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1187
|
+
var startEvent = $.Event(Event.HIDE);
|
1188
|
+
$(this._element).trigger(startEvent);
|
1189
|
+
if (startEvent.isDefaultPrevented()) {
|
1190
|
+
return;
|
1191
|
+
}
|
1196
1192
|
|
1197
|
-
|
1198
|
-
|
1199
|
-
if (startEvent.isDefaultPrevented()) {
|
1200
|
-
return;
|
1201
|
-
}
|
1193
|
+
var dimension = this._getDimension();
|
1194
|
+
var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
|
1202
1195
|
|
1203
|
-
|
1204
|
-
var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
|
1196
|
+
this._element.style[dimension] = this._element[offsetDimension] + 'px';
|
1205
1197
|
|
1206
|
-
|
1198
|
+
Util.reflow(this._element);
|
1207
1199
|
|
1208
|
-
|
1200
|
+
$(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
|
1209
1201
|
|
1210
|
-
|
1202
|
+
this._element.setAttribute('aria-expanded', false);
|
1211
1203
|
|
1212
|
-
|
1204
|
+
if (this._triggerArray.length) {
|
1205
|
+
$(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
|
1206
|
+
}
|
1213
1207
|
|
1214
|
-
|
1215
|
-
$(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
|
1216
|
-
}
|
1208
|
+
this.setTransitioning(true);
|
1217
1209
|
|
1218
|
-
|
1210
|
+
var complete = function complete() {
|
1211
|
+
_this7.setTransitioning(false);
|
1212
|
+
$(_this7._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
|
1213
|
+
};
|
1219
1214
|
|
1220
|
-
|
1221
|
-
_this5.setTransitioning(false);
|
1222
|
-
$(_this5._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
|
1223
|
-
};
|
1215
|
+
this._element.style[dimension] = '';
|
1224
1216
|
|
1225
|
-
|
1217
|
+
if (!Util.supportsTransitionEnd()) {
|
1218
|
+
complete();
|
1219
|
+
return;
|
1220
|
+
}
|
1226
1221
|
|
1227
|
-
|
1228
|
-
|
1229
|
-
return;
|
1230
|
-
}
|
1222
|
+
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
1223
|
+
};
|
1231
1224
|
|
1232
|
-
|
1233
|
-
|
1234
|
-
}
|
1235
|
-
key: 'setTransitioning',
|
1236
|
-
value: function setTransitioning(isTransitioning) {
|
1237
|
-
this._isTransitioning = isTransitioning;
|
1238
|
-
}
|
1239
|
-
}, {
|
1240
|
-
key: 'dispose',
|
1241
|
-
value: function dispose() {
|
1242
|
-
$.removeData(this._element, DATA_KEY);
|
1225
|
+
Collapse.prototype.setTransitioning = function setTransitioning(isTransitioning) {
|
1226
|
+
this._isTransitioning = isTransitioning;
|
1227
|
+
};
|
1243
1228
|
|
1244
|
-
|
1245
|
-
|
1246
|
-
this._element = null;
|
1247
|
-
this._triggerArray = null;
|
1248
|
-
this._isTransitioning = null;
|
1249
|
-
}
|
1229
|
+
Collapse.prototype.dispose = function dispose() {
|
1230
|
+
$.removeData(this._element, DATA_KEY);
|
1250
1231
|
|
1251
|
-
|
1232
|
+
this._config = null;
|
1233
|
+
this._parent = null;
|
1234
|
+
this._element = null;
|
1235
|
+
this._triggerArray = null;
|
1236
|
+
this._isTransitioning = null;
|
1237
|
+
};
|
1252
1238
|
|
1253
|
-
|
1254
|
-
key: '_getConfig',
|
1255
|
-
value: function _getConfig(config) {
|
1256
|
-
config = $.extend({}, Default, config);
|
1257
|
-
config.toggle = Boolean(config.toggle); // coerce string values
|
1258
|
-
Util.typeCheckConfig(NAME, config, DefaultType);
|
1259
|
-
return config;
|
1260
|
-
}
|
1261
|
-
}, {
|
1262
|
-
key: '_getDimension',
|
1263
|
-
value: function _getDimension() {
|
1264
|
-
var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
|
1265
|
-
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
|
1266
|
-
}
|
1267
|
-
}, {
|
1268
|
-
key: '_getParent',
|
1269
|
-
value: function _getParent() {
|
1270
|
-
var _this6 = this;
|
1239
|
+
// private
|
1271
1240
|
|
1272
|
-
|
1273
|
-
|
1241
|
+
Collapse.prototype._getConfig = function _getConfig(config) {
|
1242
|
+
config = $.extend({}, Default, config);
|
1243
|
+
config.toggle = Boolean(config.toggle); // coerce string values
|
1244
|
+
Util.typeCheckConfig(NAME, config, DefaultType);
|
1245
|
+
return config;
|
1246
|
+
};
|
1274
1247
|
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1248
|
+
Collapse.prototype._getDimension = function _getDimension() {
|
1249
|
+
var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
|
1250
|
+
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
|
1251
|
+
};
|
1278
1252
|
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1253
|
+
Collapse.prototype._getParent = function _getParent() {
|
1254
|
+
var _this8 = this;
|
1255
|
+
|
1256
|
+
var parent = $(this._config.parent)[0];
|
1257
|
+
var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';
|
1258
|
+
|
1259
|
+
$(parent).find(selector).each(function (i, element) {
|
1260
|
+
_this8._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
|
1261
|
+
});
|
1262
|
+
|
1263
|
+
return parent;
|
1264
|
+
};
|
1265
|
+
|
1266
|
+
Collapse.prototype._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
|
1267
|
+
if (element) {
|
1268
|
+
var isOpen = $(element).hasClass(ClassName.SHOW);
|
1269
|
+
element.setAttribute('aria-expanded', isOpen);
|
1270
|
+
|
1271
|
+
if (triggerArray.length) {
|
1272
|
+
$(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
1291
1273
|
}
|
1292
1274
|
}
|
1275
|
+
};
|
1293
1276
|
|
1294
|
-
|
1277
|
+
// static
|
1295
1278
|
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
return selector ? $(selector)[0] : null;
|
1301
|
-
}
|
1302
|
-
}, {
|
1303
|
-
key: '_jQueryInterface',
|
1304
|
-
value: function _jQueryInterface(config) {
|
1305
|
-
return this.each(function () {
|
1306
|
-
var $this = $(this);
|
1307
|
-
var data = $this.data(DATA_KEY);
|
1308
|
-
var _config = $.extend({}, Default, $this.data(), typeof config === 'object' && config);
|
1309
|
-
|
1310
|
-
if (!data && _config.toggle && /show|hide/.test(config)) {
|
1311
|
-
_config.toggle = false;
|
1312
|
-
}
|
1279
|
+
Collapse._getTargetFromElement = function _getTargetFromElement(element) {
|
1280
|
+
var selector = Util.getSelectorFromElement(element);
|
1281
|
+
return selector ? $(selector)[0] : null;
|
1282
|
+
};
|
1313
1283
|
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1284
|
+
Collapse._jQueryInterface = function _jQueryInterface(config) {
|
1285
|
+
return this.each(function () {
|
1286
|
+
var $this = $(this);
|
1287
|
+
var data = $this.data(DATA_KEY);
|
1288
|
+
var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
|
1318
1289
|
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1290
|
+
if (!data && _config.toggle && /show|hide/.test(config)) {
|
1291
|
+
_config.toggle = false;
|
1292
|
+
}
|
1293
|
+
|
1294
|
+
if (!data) {
|
1295
|
+
data = new Collapse(this, _config);
|
1296
|
+
$this.data(DATA_KEY, data);
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
if (typeof config === 'string') {
|
1300
|
+
if (data[config] === undefined) {
|
1301
|
+
throw new Error('No method named "' + config + '"');
|
1324
1302
|
}
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1303
|
+
data[config]();
|
1304
|
+
}
|
1305
|
+
});
|
1306
|
+
};
|
1307
|
+
|
1308
|
+
_createClass(Collapse, null, [{
|
1328
1309
|
key: 'VERSION',
|
1329
1310
|
get: function get() {
|
1330
1311
|
return VERSION;
|
@@ -1337,7 +1318,13 @@ var Collapse = (function ($) {
|
|
1337
1318
|
}]);
|
1338
1319
|
|
1339
1320
|
return Collapse;
|
1340
|
-
}
|
1321
|
+
}();
|
1322
|
+
|
1323
|
+
/**
|
1324
|
+
* ------------------------------------------------------------------------
|
1325
|
+
* Data Api implementation
|
1326
|
+
* ------------------------------------------------------------------------
|
1327
|
+
*/
|
1341
1328
|
|
1342
1329
|
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
1343
1330
|
event.preventDefault();
|
@@ -1363,16 +1350,16 @@ var Collapse = (function ($) {
|
|
1363
1350
|
};
|
1364
1351
|
|
1365
1352
|
return Collapse;
|
1366
|
-
}
|
1353
|
+
}(jQuery);
|
1367
1354
|
|
1368
1355
|
/**
|
1369
1356
|
* --------------------------------------------------------------------------
|
1370
|
-
* Bootstrap (v4.0.0-alpha.
|
1357
|
+
* Bootstrap (v4.0.0-alpha.6): dropdown.js
|
1371
1358
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1372
1359
|
* --------------------------------------------------------------------------
|
1373
1360
|
*/
|
1374
1361
|
|
1375
|
-
var Dropdown =
|
1362
|
+
var Dropdown = function ($) {
|
1376
1363
|
|
1377
1364
|
/**
|
1378
1365
|
* ------------------------------------------------------------------------
|
@@ -1381,11 +1368,15 @@ var Dropdown = (function ($) {
|
|
1381
1368
|
*/
|
1382
1369
|
|
1383
1370
|
var NAME = 'dropdown';
|
1384
|
-
var VERSION = '4.0.0-alpha';
|
1371
|
+
var VERSION = '4.0.0-alpha.6';
|
1385
1372
|
var DATA_KEY = 'bs.dropdown';
|
1386
1373
|
var EVENT_KEY = '.' + DATA_KEY;
|
1387
1374
|
var DATA_API_KEY = '.data-api';
|
1388
1375
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
1376
|
+
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
1377
|
+
var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
|
1378
|
+
var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
|
1379
|
+
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
|
1389
1380
|
|
1390
1381
|
var Event = {
|
1391
1382
|
HIDE: 'hide' + EVENT_KEY,
|
@@ -1394,13 +1385,14 @@ var Dropdown = (function ($) {
|
|
1394
1385
|
SHOWN: 'shown' + EVENT_KEY,
|
1395
1386
|
CLICK: 'click' + EVENT_KEY,
|
1396
1387
|
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
|
1388
|
+
FOCUSIN_DATA_API: 'focusin' + EVENT_KEY + DATA_API_KEY,
|
1397
1389
|
KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY
|
1398
1390
|
};
|
1399
1391
|
|
1400
1392
|
var ClassName = {
|
1401
1393
|
BACKDROP: 'dropdown-backdrop',
|
1402
1394
|
DISABLED: 'disabled',
|
1403
|
-
|
1395
|
+
SHOW: 'show'
|
1404
1396
|
};
|
1405
1397
|
|
1406
1398
|
var Selector = {
|
@@ -1419,7 +1411,7 @@ var Dropdown = (function ($) {
|
|
1419
1411
|
* ------------------------------------------------------------------------
|
1420
1412
|
*/
|
1421
1413
|
|
1422
|
-
var Dropdown =
|
1414
|
+
var Dropdown = function () {
|
1423
1415
|
function Dropdown(element) {
|
1424
1416
|
_classCallCheck(this, Dropdown);
|
1425
1417
|
|
@@ -1428,201 +1420,186 @@ var Dropdown = (function ($) {
|
|
1428
1420
|
this._addEventListeners();
|
1429
1421
|
}
|
1430
1422
|
|
1431
|
-
/**
|
1432
|
-
* ------------------------------------------------------------------------
|
1433
|
-
* Data Api implementation
|
1434
|
-
* ------------------------------------------------------------------------
|
1435
|
-
*/
|
1436
|
-
|
1437
1423
|
// getters
|
1438
1424
|
|
1439
|
-
|
1440
|
-
key: 'toggle',
|
1425
|
+
// public
|
1441
1426
|
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
return false;
|
1447
|
-
}
|
1427
|
+
Dropdown.prototype.toggle = function toggle() {
|
1428
|
+
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
1429
|
+
return false;
|
1430
|
+
}
|
1448
1431
|
|
1449
|
-
|
1450
|
-
|
1432
|
+
var parent = Dropdown._getParentFromElement(this);
|
1433
|
+
var isActive = $(parent).hasClass(ClassName.SHOW);
|
1451
1434
|
|
1452
|
-
|
1435
|
+
Dropdown._clearMenus();
|
1453
1436
|
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1437
|
+
if (isActive) {
|
1438
|
+
return false;
|
1439
|
+
}
|
1457
1440
|
|
1458
|
-
|
1441
|
+
if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
|
1459
1442
|
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1443
|
+
// if mobile we use a backdrop because click events don't delegate
|
1444
|
+
var dropdown = document.createElement('div');
|
1445
|
+
dropdown.className = ClassName.BACKDROP;
|
1446
|
+
$(dropdown).insertBefore(this);
|
1447
|
+
$(dropdown).on('click', Dropdown._clearMenus);
|
1448
|
+
}
|
1466
1449
|
|
1467
|
-
|
1468
|
-
|
1450
|
+
var relatedTarget = {
|
1451
|
+
relatedTarget: this
|
1452
|
+
};
|
1453
|
+
var showEvent = $.Event(Event.SHOW, relatedTarget);
|
1469
1454
|
|
1470
|
-
|
1455
|
+
$(parent).trigger(showEvent);
|
1471
1456
|
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1457
|
+
if (showEvent.isDefaultPrevented()) {
|
1458
|
+
return false;
|
1459
|
+
}
|
1475
1460
|
|
1476
|
-
|
1477
|
-
|
1461
|
+
this.focus();
|
1462
|
+
this.setAttribute('aria-expanded', true);
|
1478
1463
|
|
1479
|
-
|
1480
|
-
|
1464
|
+
$(parent).toggleClass(ClassName.SHOW);
|
1465
|
+
$(parent).trigger($.Event(Event.SHOWN, relatedTarget));
|
1481
1466
|
|
1482
|
-
|
1483
|
-
|
1484
|
-
}, {
|
1485
|
-
key: 'dispose',
|
1486
|
-
value: function dispose() {
|
1487
|
-
$.removeData(this._element, DATA_KEY);
|
1488
|
-
$(this._element).off(EVENT_KEY);
|
1489
|
-
this._element = null;
|
1490
|
-
}
|
1467
|
+
return false;
|
1468
|
+
};
|
1491
1469
|
|
1492
|
-
|
1470
|
+
Dropdown.prototype.dispose = function dispose() {
|
1471
|
+
$.removeData(this._element, DATA_KEY);
|
1472
|
+
$(this._element).off(EVENT_KEY);
|
1473
|
+
this._element = null;
|
1474
|
+
};
|
1493
1475
|
|
1494
|
-
|
1495
|
-
key: '_addEventListeners',
|
1496
|
-
value: function _addEventListeners() {
|
1497
|
-
$(this._element).on(Event.CLICK, this.toggle);
|
1498
|
-
}
|
1476
|
+
// private
|
1499
1477
|
|
1500
|
-
|
1478
|
+
Dropdown.prototype._addEventListeners = function _addEventListeners() {
|
1479
|
+
$(this._element).on(Event.CLICK, this.toggle);
|
1480
|
+
};
|
1501
1481
|
|
1502
|
-
|
1503
|
-
key: '_jQueryInterface',
|
1504
|
-
value: function _jQueryInterface(config) {
|
1505
|
-
return this.each(function () {
|
1506
|
-
var data = $(this).data(DATA_KEY);
|
1482
|
+
// static
|
1507
1483
|
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1484
|
+
Dropdown._jQueryInterface = function _jQueryInterface(config) {
|
1485
|
+
return this.each(function () {
|
1486
|
+
var data = $(this).data(DATA_KEY);
|
1511
1487
|
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
}
|
1516
|
-
data[config].call(this);
|
1517
|
-
}
|
1518
|
-
});
|
1519
|
-
}
|
1520
|
-
}, {
|
1521
|
-
key: '_clearMenus',
|
1522
|
-
value: function _clearMenus(event) {
|
1523
|
-
if (event && event.which === 3) {
|
1524
|
-
return;
|
1488
|
+
if (!data) {
|
1489
|
+
data = new Dropdown(this);
|
1490
|
+
$(this).data(DATA_KEY, data);
|
1525
1491
|
}
|
1526
1492
|
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1493
|
+
if (typeof config === 'string') {
|
1494
|
+
if (data[config] === undefined) {
|
1495
|
+
throw new Error('No method named "' + config + '"');
|
1496
|
+
}
|
1497
|
+
data[config].call(this);
|
1530
1498
|
}
|
1499
|
+
});
|
1500
|
+
};
|
1531
1501
|
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
var relatedTarget = { relatedTarget: toggles[i] };
|
1502
|
+
Dropdown._clearMenus = function _clearMenus(event) {
|
1503
|
+
if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {
|
1504
|
+
return;
|
1505
|
+
}
|
1537
1506
|
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1507
|
+
var backdrop = $(Selector.BACKDROP)[0];
|
1508
|
+
if (backdrop) {
|
1509
|
+
backdrop.parentNode.removeChild(backdrop);
|
1510
|
+
}
|
1541
1511
|
|
1542
|
-
|
1543
|
-
continue;
|
1544
|
-
}
|
1512
|
+
var toggles = $.makeArray($(Selector.DATA_TOGGLE));
|
1545
1513
|
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1514
|
+
for (var i = 0; i < toggles.length; i++) {
|
1515
|
+
var parent = Dropdown._getParentFromElement(toggles[i]);
|
1516
|
+
var relatedTarget = {
|
1517
|
+
relatedTarget: toggles[i]
|
1518
|
+
};
|
1551
1519
|
|
1552
|
-
|
1520
|
+
if (!$(parent).hasClass(ClassName.SHOW)) {
|
1521
|
+
continue;
|
1522
|
+
}
|
1553
1523
|
|
1554
|
-
|
1524
|
+
if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'focusin') && $.contains(parent, event.target)) {
|
1525
|
+
continue;
|
1555
1526
|
}
|
1556
|
-
}
|
1557
|
-
}, {
|
1558
|
-
key: '_getParentFromElement',
|
1559
|
-
value: function _getParentFromElement(element) {
|
1560
|
-
var parent = undefined;
|
1561
|
-
var selector = Util.getSelectorFromElement(element);
|
1562
1527
|
|
1563
|
-
|
1564
|
-
|
1528
|
+
var hideEvent = $.Event(Event.HIDE, relatedTarget);
|
1529
|
+
$(parent).trigger(hideEvent);
|
1530
|
+
if (hideEvent.isDefaultPrevented()) {
|
1531
|
+
continue;
|
1565
1532
|
}
|
1566
1533
|
|
1567
|
-
|
1534
|
+
toggles[i].setAttribute('aria-expanded', 'false');
|
1535
|
+
|
1536
|
+
$(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
|
1568
1537
|
}
|
1569
|
-
}
|
1570
|
-
key: '_dataApiKeydownHandler',
|
1571
|
-
value: function _dataApiKeydownHandler(event) {
|
1572
|
-
if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
|
1573
|
-
return;
|
1574
|
-
}
|
1538
|
+
};
|
1575
1539
|
|
1576
|
-
|
1577
|
-
|
1540
|
+
Dropdown._getParentFromElement = function _getParentFromElement(element) {
|
1541
|
+
var parent = void 0;
|
1542
|
+
var selector = Util.getSelectorFromElement(element);
|
1578
1543
|
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1544
|
+
if (selector) {
|
1545
|
+
parent = $(selector)[0];
|
1546
|
+
}
|
1582
1547
|
|
1583
|
-
|
1584
|
-
|
1548
|
+
return parent || element.parentNode;
|
1549
|
+
};
|
1585
1550
|
|
1586
|
-
|
1551
|
+
Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
|
1552
|
+
if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
|
1553
|
+
return;
|
1554
|
+
}
|
1587
1555
|
|
1588
|
-
|
1589
|
-
|
1590
|
-
$(toggle).trigger('focus');
|
1591
|
-
}
|
1556
|
+
event.preventDefault();
|
1557
|
+
event.stopPropagation();
|
1592
1558
|
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1559
|
+
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
1560
|
+
return;
|
1561
|
+
}
|
1596
1562
|
|
1597
|
-
|
1563
|
+
var parent = Dropdown._getParentFromElement(this);
|
1564
|
+
var isActive = $(parent).hasClass(ClassName.SHOW);
|
1598
1565
|
|
1599
|
-
|
1600
|
-
return item.offsetWidth || item.offsetHeight;
|
1601
|
-
});
|
1566
|
+
if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) {
|
1602
1567
|
|
1603
|
-
if (
|
1604
|
-
|
1568
|
+
if (event.which === ESCAPE_KEYCODE) {
|
1569
|
+
var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
|
1570
|
+
$(toggle).trigger('focus');
|
1605
1571
|
}
|
1606
1572
|
|
1607
|
-
|
1573
|
+
$(this).trigger('click');
|
1574
|
+
return;
|
1575
|
+
}
|
1608
1576
|
|
1609
|
-
|
1610
|
-
// up
|
1611
|
-
index--;
|
1612
|
-
}
|
1577
|
+
var items = $(parent).find(Selector.VISIBLE_ITEMS).get();
|
1613
1578
|
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
}
|
1579
|
+
if (!items.length) {
|
1580
|
+
return;
|
1581
|
+
}
|
1618
1582
|
|
1619
|
-
|
1620
|
-
index = 0;
|
1621
|
-
}
|
1583
|
+
var index = items.indexOf(event.target);
|
1622
1584
|
|
1623
|
-
|
1585
|
+
if (event.which === ARROW_UP_KEYCODE && index > 0) {
|
1586
|
+
// up
|
1587
|
+
index--;
|
1624
1588
|
}
|
1625
|
-
|
1589
|
+
|
1590
|
+
if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
|
1591
|
+
// down
|
1592
|
+
index++;
|
1593
|
+
}
|
1594
|
+
|
1595
|
+
if (index < 0) {
|
1596
|
+
index = 0;
|
1597
|
+
}
|
1598
|
+
|
1599
|
+
items[index].focus();
|
1600
|
+
};
|
1601
|
+
|
1602
|
+
_createClass(Dropdown, null, [{
|
1626
1603
|
key: 'VERSION',
|
1627
1604
|
get: function get() {
|
1628
1605
|
return VERSION;
|
@@ -1630,9 +1607,15 @@ var Dropdown = (function ($) {
|
|
1630
1607
|
}]);
|
1631
1608
|
|
1632
1609
|
return Dropdown;
|
1633
|
-
}
|
1610
|
+
}();
|
1611
|
+
|
1612
|
+
/**
|
1613
|
+
* ------------------------------------------------------------------------
|
1614
|
+
* Data Api implementation
|
1615
|
+
* ------------------------------------------------------------------------
|
1616
|
+
*/
|
1634
1617
|
|
1635
|
-
$(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
|
1618
|
+
$(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + ' ' + Event.FOCUSIN_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
|
1636
1619
|
e.stopPropagation();
|
1637
1620
|
});
|
1638
1621
|
|
@@ -1650,16 +1633,16 @@ var Dropdown = (function ($) {
|
|
1650
1633
|
};
|
1651
1634
|
|
1652
1635
|
return Dropdown;
|
1653
|
-
}
|
1636
|
+
}(jQuery);
|
1654
1637
|
|
1655
1638
|
/**
|
1656
1639
|
* --------------------------------------------------------------------------
|
1657
|
-
* Bootstrap (v4.0.0-alpha.
|
1640
|
+
* Bootstrap (v4.0.0-alpha.6): modal.js
|
1658
1641
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1659
1642
|
* --------------------------------------------------------------------------
|
1660
1643
|
*/
|
1661
1644
|
|
1662
|
-
var Modal =
|
1645
|
+
var Modal = function ($) {
|
1663
1646
|
|
1664
1647
|
/**
|
1665
1648
|
* ------------------------------------------------------------------------
|
@@ -1668,13 +1651,14 @@ var Modal = (function ($) {
|
|
1668
1651
|
*/
|
1669
1652
|
|
1670
1653
|
var NAME = 'modal';
|
1671
|
-
var VERSION = '4.0.0-alpha';
|
1654
|
+
var VERSION = '4.0.0-alpha.6';
|
1672
1655
|
var DATA_KEY = 'bs.modal';
|
1673
1656
|
var EVENT_KEY = '.' + DATA_KEY;
|
1674
1657
|
var DATA_API_KEY = '.data-api';
|
1675
1658
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
1676
1659
|
var TRANSITION_DURATION = 300;
|
1677
1660
|
var BACKDROP_TRANSITION_DURATION = 150;
|
1661
|
+
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
1678
1662
|
|
1679
1663
|
var Default = {
|
1680
1664
|
backdrop: true,
|
@@ -1709,14 +1693,14 @@ var Modal = (function ($) {
|
|
1709
1693
|
BACKDROP: 'modal-backdrop',
|
1710
1694
|
OPEN: 'modal-open',
|
1711
1695
|
FADE: 'fade',
|
1712
|
-
|
1696
|
+
SHOW: 'show'
|
1713
1697
|
};
|
1714
1698
|
|
1715
1699
|
var Selector = {
|
1716
1700
|
DIALOG: '.modal-dialog',
|
1717
1701
|
DATA_TOGGLE: '[data-toggle="modal"]',
|
1718
1702
|
DATA_DISMISS: '[data-dismiss="modal"]',
|
1719
|
-
FIXED_CONTENT: '.
|
1703
|
+
FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'
|
1720
1704
|
};
|
1721
1705
|
|
1722
1706
|
/**
|
@@ -1725,7 +1709,7 @@ var Modal = (function ($) {
|
|
1725
1709
|
* ------------------------------------------------------------------------
|
1726
1710
|
*/
|
1727
1711
|
|
1728
|
-
var Modal =
|
1712
|
+
var Modal = function () {
|
1729
1713
|
function Modal(element, config) {
|
1730
1714
|
_classCallCheck(this, Modal);
|
1731
1715
|
|
@@ -1736,390 +1720,382 @@ var Modal = (function ($) {
|
|
1736
1720
|
this._isShown = false;
|
1737
1721
|
this._isBodyOverflowing = false;
|
1738
1722
|
this._ignoreBackdropClick = false;
|
1723
|
+
this._isTransitioning = false;
|
1739
1724
|
this._originalBodyPadding = 0;
|
1740
1725
|
this._scrollbarWidth = 0;
|
1741
1726
|
}
|
1742
1727
|
|
1743
|
-
/**
|
1744
|
-
* ------------------------------------------------------------------------
|
1745
|
-
* Data Api implementation
|
1746
|
-
* ------------------------------------------------------------------------
|
1747
|
-
*/
|
1748
|
-
|
1749
1728
|
// getters
|
1750
1729
|
|
1751
|
-
|
1752
|
-
|
1730
|
+
// public
|
1731
|
+
|
1732
|
+
Modal.prototype.toggle = function toggle(relatedTarget) {
|
1733
|
+
return this._isShown ? this.hide() : this.show(relatedTarget);
|
1734
|
+
};
|
1753
1735
|
|
1754
|
-
|
1736
|
+
Modal.prototype.show = function show(relatedTarget) {
|
1737
|
+
var _this9 = this;
|
1755
1738
|
|
1756
|
-
|
1757
|
-
|
1739
|
+
if (this._isTransitioning) {
|
1740
|
+
throw new Error('Modal is transitioning');
|
1758
1741
|
}
|
1759
|
-
}, {
|
1760
|
-
key: 'show',
|
1761
|
-
value: function show(relatedTarget) {
|
1762
|
-
var _this7 = this;
|
1763
1742
|
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1743
|
+
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
|
1744
|
+
this._isTransitioning = true;
|
1745
|
+
}
|
1746
|
+
var showEvent = $.Event(Event.SHOW, {
|
1747
|
+
relatedTarget: relatedTarget
|
1748
|
+
});
|
1767
1749
|
|
1768
|
-
|
1750
|
+
$(this._element).trigger(showEvent);
|
1769
1751
|
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1752
|
+
if (this._isShown || showEvent.isDefaultPrevented()) {
|
1753
|
+
return;
|
1754
|
+
}
|
1773
1755
|
|
1774
|
-
|
1756
|
+
this._isShown = true;
|
1775
1757
|
|
1776
|
-
|
1777
|
-
|
1758
|
+
this._checkScrollbar();
|
1759
|
+
this._setScrollbar();
|
1778
1760
|
|
1779
|
-
|
1761
|
+
$(document.body).addClass(ClassName.OPEN);
|
1780
1762
|
|
1781
|
-
|
1782
|
-
|
1763
|
+
this._setEscapeEvent();
|
1764
|
+
this._setResizeEvent();
|
1783
1765
|
|
1784
|
-
|
1766
|
+
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
|
1767
|
+
return _this9.hide(event);
|
1768
|
+
});
|
1785
1769
|
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
});
|
1770
|
+
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
|
1771
|
+
$(_this9._element).one(Event.MOUSEUP_DISMISS, function (event) {
|
1772
|
+
if ($(event.target).is(_this9._element)) {
|
1773
|
+
_this9._ignoreBackdropClick = true;
|
1774
|
+
}
|
1792
1775
|
});
|
1776
|
+
});
|
1793
1777
|
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
value: function hide(event) {
|
1799
|
-
if (event) {
|
1800
|
-
event.preventDefault();
|
1801
|
-
}
|
1778
|
+
this._showBackdrop(function () {
|
1779
|
+
return _this9._showElement(relatedTarget);
|
1780
|
+
});
|
1781
|
+
};
|
1802
1782
|
|
1803
|
-
|
1783
|
+
Modal.prototype.hide = function hide(event) {
|
1784
|
+
var _this10 = this;
|
1804
1785
|
|
1805
|
-
|
1786
|
+
if (event) {
|
1787
|
+
event.preventDefault();
|
1788
|
+
}
|
1806
1789
|
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1790
|
+
if (this._isTransitioning) {
|
1791
|
+
throw new Error('Modal is transitioning');
|
1792
|
+
}
|
1810
1793
|
|
1811
|
-
|
1794
|
+
var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
|
1795
|
+
if (transition) {
|
1796
|
+
this._isTransitioning = true;
|
1797
|
+
}
|
1812
1798
|
|
1813
|
-
|
1814
|
-
|
1799
|
+
var hideEvent = $.Event(Event.HIDE);
|
1800
|
+
$(this._element).trigger(hideEvent);
|
1815
1801
|
|
1816
|
-
|
1802
|
+
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
1803
|
+
return;
|
1804
|
+
}
|
1817
1805
|
|
1818
|
-
|
1806
|
+
this._isShown = false;
|
1819
1807
|
|
1820
|
-
|
1821
|
-
|
1808
|
+
this._setEscapeEvent();
|
1809
|
+
this._setResizeEvent();
|
1822
1810
|
|
1823
|
-
|
1811
|
+
$(document).off(Event.FOCUSIN);
|
1824
1812
|
|
1825
|
-
|
1826
|
-
} else {
|
1827
|
-
this._hideModal();
|
1828
|
-
}
|
1829
|
-
}
|
1830
|
-
}, {
|
1831
|
-
key: 'dispose',
|
1832
|
-
value: function dispose() {
|
1833
|
-
$.removeData(this._element, DATA_KEY);
|
1834
|
-
|
1835
|
-
$(window).off(EVENT_KEY);
|
1836
|
-
$(document).off(EVENT_KEY);
|
1837
|
-
$(this._element).off(EVENT_KEY);
|
1838
|
-
$(this._backdrop).off(EVENT_KEY);
|
1839
|
-
|
1840
|
-
this._config = null;
|
1841
|
-
this._element = null;
|
1842
|
-
this._dialog = null;
|
1843
|
-
this._backdrop = null;
|
1844
|
-
this._isShown = null;
|
1845
|
-
this._isBodyOverflowing = null;
|
1846
|
-
this._ignoreBackdropClick = null;
|
1847
|
-
this._originalBodyPadding = null;
|
1848
|
-
this._scrollbarWidth = null;
|
1849
|
-
}
|
1813
|
+
$(this._element).removeClass(ClassName.SHOW);
|
1850
1814
|
|
1851
|
-
|
1815
|
+
$(this._element).off(Event.CLICK_DISMISS);
|
1816
|
+
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
|
1852
1817
|
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1818
|
+
if (transition) {
|
1819
|
+
$(this._element).one(Util.TRANSITION_END, function (event) {
|
1820
|
+
return _this10._hideModal(event);
|
1821
|
+
}).emulateTransitionEnd(TRANSITION_DURATION);
|
1822
|
+
} else {
|
1823
|
+
this._hideModal();
|
1859
1824
|
}
|
1860
|
-
}
|
1861
|
-
key: '_showElement',
|
1862
|
-
value: function _showElement(relatedTarget) {
|
1863
|
-
var _this8 = this;
|
1825
|
+
};
|
1864
1826
|
|
1865
|
-
|
1827
|
+
Modal.prototype.dispose = function dispose() {
|
1828
|
+
$.removeData(this._element, DATA_KEY);
|
1866
1829
|
|
1867
|
-
|
1868
|
-
// don't move modals dom position
|
1869
|
-
document.body.appendChild(this._element);
|
1870
|
-
}
|
1830
|
+
$(window, document, this._element, this._backdrop).off(EVENT_KEY);
|
1871
1831
|
|
1872
|
-
|
1873
|
-
|
1832
|
+
this._config = null;
|
1833
|
+
this._element = null;
|
1834
|
+
this._dialog = null;
|
1835
|
+
this._backdrop = null;
|
1836
|
+
this._isShown = null;
|
1837
|
+
this._isBodyOverflowing = null;
|
1838
|
+
this._ignoreBackdropClick = null;
|
1839
|
+
this._originalBodyPadding = null;
|
1840
|
+
this._scrollbarWidth = null;
|
1841
|
+
};
|
1874
1842
|
|
1875
|
-
|
1876
|
-
Util.reflow(this._element);
|
1877
|
-
}
|
1843
|
+
// private
|
1878
1844
|
|
1879
|
-
|
1845
|
+
Modal.prototype._getConfig = function _getConfig(config) {
|
1846
|
+
config = $.extend({}, Default, config);
|
1847
|
+
Util.typeCheckConfig(NAME, config, DefaultType);
|
1848
|
+
return config;
|
1849
|
+
};
|
1880
1850
|
|
1881
|
-
|
1882
|
-
|
1883
|
-
}
|
1851
|
+
Modal.prototype._showElement = function _showElement(relatedTarget) {
|
1852
|
+
var _this11 = this;
|
1884
1853
|
|
1885
|
-
|
1886
|
-
relatedTarget: relatedTarget
|
1887
|
-
});
|
1854
|
+
var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
|
1888
1855
|
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
$(_this8._element).trigger(shownEvent);
|
1894
|
-
};
|
1856
|
+
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
1857
|
+
// don't move modals dom position
|
1858
|
+
document.body.appendChild(this._element);
|
1859
|
+
}
|
1895
1860
|
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1861
|
+
this._element.style.display = 'block';
|
1862
|
+
this._element.removeAttribute('aria-hidden');
|
1863
|
+
this._element.scrollTop = 0;
|
1864
|
+
|
1865
|
+
if (transition) {
|
1866
|
+
Util.reflow(this._element);
|
1901
1867
|
}
|
1902
|
-
|
1903
|
-
|
1904
|
-
|
1905
|
-
|
1906
|
-
|
1907
|
-
$(document).off(Event.FOCUSIN) // guard against infinite focus loop
|
1908
|
-
.on(Event.FOCUSIN, function (event) {
|
1909
|
-
if (_this9._element !== event.target && !$(_this9._element).has(event.target).length) {
|
1910
|
-
_this9._element.focus();
|
1911
|
-
}
|
1912
|
-
});
|
1868
|
+
|
1869
|
+
$(this._element).addClass(ClassName.SHOW);
|
1870
|
+
|
1871
|
+
if (this._config.focus) {
|
1872
|
+
this._enforceFocus();
|
1913
1873
|
}
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1922
|
-
_this10.hide();
|
1923
|
-
}
|
1924
|
-
});
|
1925
|
-
} else if (!this._isShown) {
|
1926
|
-
$(this._element).off(Event.KEYDOWN_DISMISS);
|
1874
|
+
|
1875
|
+
var shownEvent = $.Event(Event.SHOWN, {
|
1876
|
+
relatedTarget: relatedTarget
|
1877
|
+
});
|
1878
|
+
|
1879
|
+
var transitionComplete = function transitionComplete() {
|
1880
|
+
if (_this11._config.focus) {
|
1881
|
+
_this11._element.focus();
|
1927
1882
|
}
|
1883
|
+
_this11._isTransitioning = false;
|
1884
|
+
$(_this11._element).trigger(shownEvent);
|
1885
|
+
};
|
1886
|
+
|
1887
|
+
if (transition) {
|
1888
|
+
$(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
|
1889
|
+
} else {
|
1890
|
+
transitionComplete();
|
1928
1891
|
}
|
1929
|
-
}
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1892
|
+
};
|
1893
|
+
|
1894
|
+
Modal.prototype._enforceFocus = function _enforceFocus() {
|
1895
|
+
var _this12 = this;
|
1896
|
+
|
1897
|
+
$(document).off(Event.FOCUSIN) // guard against infinite focus loop
|
1898
|
+
.on(Event.FOCUSIN, function (event) {
|
1899
|
+
if (document !== event.target && _this12._element !== event.target && !$(_this12._element).has(event.target).length) {
|
1900
|
+
_this12._element.focus();
|
1936
1901
|
}
|
1937
|
-
}
|
1938
|
-
}
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
this.
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
$(_this11._element).trigger(Event.HIDDEN);
|
1902
|
+
});
|
1903
|
+
};
|
1904
|
+
|
1905
|
+
Modal.prototype._setEscapeEvent = function _setEscapeEvent() {
|
1906
|
+
var _this13 = this;
|
1907
|
+
|
1908
|
+
if (this._isShown && this._config.keyboard) {
|
1909
|
+
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
|
1910
|
+
if (event.which === ESCAPE_KEYCODE) {
|
1911
|
+
_this13.hide();
|
1912
|
+
}
|
1949
1913
|
});
|
1914
|
+
} else if (!this._isShown) {
|
1915
|
+
$(this._element).off(Event.KEYDOWN_DISMISS);
|
1950
1916
|
}
|
1951
|
-
}
|
1952
|
-
|
1953
|
-
|
1954
|
-
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1917
|
+
};
|
1918
|
+
|
1919
|
+
Modal.prototype._setResizeEvent = function _setResizeEvent() {
|
1920
|
+
var _this14 = this;
|
1921
|
+
|
1922
|
+
if (this._isShown) {
|
1923
|
+
$(window).on(Event.RESIZE, function (event) {
|
1924
|
+
return _this14._handleUpdate(event);
|
1925
|
+
});
|
1926
|
+
} else {
|
1927
|
+
$(window).off(Event.RESIZE);
|
1958
1928
|
}
|
1959
|
-
}
|
1960
|
-
key: '_showBackdrop',
|
1961
|
-
value: function _showBackdrop(callback) {
|
1962
|
-
var _this12 = this;
|
1929
|
+
};
|
1963
1930
|
|
1964
|
-
|
1931
|
+
Modal.prototype._hideModal = function _hideModal() {
|
1932
|
+
var _this15 = this;
|
1965
1933
|
|
1966
|
-
|
1967
|
-
|
1934
|
+
this._element.style.display = 'none';
|
1935
|
+
this._element.setAttribute('aria-hidden', 'true');
|
1936
|
+
this._isTransitioning = false;
|
1937
|
+
this._showBackdrop(function () {
|
1938
|
+
$(document.body).removeClass(ClassName.OPEN);
|
1939
|
+
_this15._resetAdjustments();
|
1940
|
+
_this15._resetScrollbar();
|
1941
|
+
$(_this15._element).trigger(Event.HIDDEN);
|
1942
|
+
});
|
1943
|
+
};
|
1968
1944
|
|
1969
|
-
|
1970
|
-
|
1945
|
+
Modal.prototype._removeBackdrop = function _removeBackdrop() {
|
1946
|
+
if (this._backdrop) {
|
1947
|
+
$(this._backdrop).remove();
|
1948
|
+
this._backdrop = null;
|
1949
|
+
}
|
1950
|
+
};
|
1971
1951
|
|
1972
|
-
|
1973
|
-
|
1974
|
-
}
|
1952
|
+
Modal.prototype._showBackdrop = function _showBackdrop(callback) {
|
1953
|
+
var _this16 = this;
|
1975
1954
|
|
1976
|
-
|
1955
|
+
var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
|
1977
1956
|
|
1978
|
-
|
1979
|
-
|
1980
|
-
_this12._ignoreBackdropClick = false;
|
1981
|
-
return;
|
1982
|
-
}
|
1983
|
-
if (event.target !== event.currentTarget) {
|
1984
|
-
return;
|
1985
|
-
}
|
1986
|
-
if (_this12._config.backdrop === 'static') {
|
1987
|
-
_this12._element.focus();
|
1988
|
-
} else {
|
1989
|
-
_this12.hide();
|
1990
|
-
}
|
1991
|
-
});
|
1957
|
+
if (this._isShown && this._config.backdrop) {
|
1958
|
+
var doAnimate = Util.supportsTransitionEnd() && animate;
|
1992
1959
|
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1960
|
+
this._backdrop = document.createElement('div');
|
1961
|
+
this._backdrop.className = ClassName.BACKDROP;
|
1962
|
+
|
1963
|
+
if (animate) {
|
1964
|
+
$(this._backdrop).addClass(animate);
|
1965
|
+
}
|
1996
1966
|
|
1997
|
-
|
1967
|
+
$(this._backdrop).appendTo(document.body);
|
1998
1968
|
|
1999
|
-
|
1969
|
+
$(this._element).on(Event.CLICK_DISMISS, function (event) {
|
1970
|
+
if (_this16._ignoreBackdropClick) {
|
1971
|
+
_this16._ignoreBackdropClick = false;
|
2000
1972
|
return;
|
2001
1973
|
}
|
2002
|
-
|
2003
|
-
if (!doAnimate) {
|
2004
|
-
callback();
|
1974
|
+
if (event.target !== event.currentTarget) {
|
2005
1975
|
return;
|
2006
1976
|
}
|
1977
|
+
if (_this16._config.backdrop === 'static') {
|
1978
|
+
_this16._element.focus();
|
1979
|
+
} else {
|
1980
|
+
_this16.hide();
|
1981
|
+
}
|
1982
|
+
});
|
2007
1983
|
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
1984
|
+
if (doAnimate) {
|
1985
|
+
Util.reflow(this._backdrop);
|
1986
|
+
}
|
2011
1987
|
|
2012
|
-
|
2013
|
-
_this12._removeBackdrop();
|
2014
|
-
if (callback) {
|
2015
|
-
callback();
|
2016
|
-
}
|
2017
|
-
};
|
1988
|
+
$(this._backdrop).addClass(ClassName.SHOW);
|
2018
1989
|
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
} else if (callback) {
|
1990
|
+
if (!callback) {
|
1991
|
+
return;
|
1992
|
+
}
|
1993
|
+
|
1994
|
+
if (!doAnimate) {
|
2025
1995
|
callback();
|
1996
|
+
return;
|
2026
1997
|
}
|
2027
|
-
}
|
2028
1998
|
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
// ----------------------------------------------------------------------
|
1999
|
+
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
|
2000
|
+
} else if (!this._isShown && this._backdrop) {
|
2001
|
+
$(this._backdrop).removeClass(ClassName.SHOW);
|
2033
2002
|
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2040
|
-
key: '_adjustDialog',
|
2041
|
-
value: function _adjustDialog() {
|
2042
|
-
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
2003
|
+
var callbackRemove = function callbackRemove() {
|
2004
|
+
_this16._removeBackdrop();
|
2005
|
+
if (callback) {
|
2006
|
+
callback();
|
2007
|
+
}
|
2008
|
+
};
|
2043
2009
|
|
2044
|
-
if (
|
2045
|
-
this.
|
2010
|
+
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
|
2011
|
+
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
|
2012
|
+
} else {
|
2013
|
+
callbackRemove();
|
2046
2014
|
}
|
2015
|
+
} else if (callback) {
|
2016
|
+
callback();
|
2017
|
+
}
|
2018
|
+
};
|
2047
2019
|
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2020
|
+
// ----------------------------------------------------------------------
|
2021
|
+
// the following methods are used to handle overflowing modals
|
2022
|
+
// todo (fat): these should probably be refactored out of modal.js
|
2023
|
+
// ----------------------------------------------------------------------
|
2024
|
+
|
2025
|
+
Modal.prototype._handleUpdate = function _handleUpdate() {
|
2026
|
+
this._adjustDialog();
|
2027
|
+
};
|
2028
|
+
|
2029
|
+
Modal.prototype._adjustDialog = function _adjustDialog() {
|
2030
|
+
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
2031
|
+
|
2032
|
+
if (!this._isBodyOverflowing && isModalOverflowing) {
|
2033
|
+
this._element.style.paddingLeft = this._scrollbarWidth + 'px';
|
2051
2034
|
}
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
this._element.style.paddingLeft = '';
|
2056
|
-
this._element.style.paddingRight = '';
|
2035
|
+
|
2036
|
+
if (this._isBodyOverflowing && !isModalOverflowing) {
|
2037
|
+
this._element.style.paddingRight = this._scrollbarWidth + 'px';
|
2057
2038
|
}
|
2058
|
-
}
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2039
|
+
};
|
2040
|
+
|
2041
|
+
Modal.prototype._resetAdjustments = function _resetAdjustments() {
|
2042
|
+
this._element.style.paddingLeft = '';
|
2043
|
+
this._element.style.paddingRight = '';
|
2044
|
+
};
|
2045
|
+
|
2046
|
+
Modal.prototype._checkScrollbar = function _checkScrollbar() {
|
2047
|
+
this._isBodyOverflowing = document.body.clientWidth < window.innerWidth;
|
2048
|
+
this._scrollbarWidth = this._getScrollbarWidth();
|
2049
|
+
};
|
2050
|
+
|
2051
|
+
Modal.prototype._setScrollbar = function _setScrollbar() {
|
2052
|
+
var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
|
2053
|
+
|
2054
|
+
this._originalBodyPadding = document.body.style.paddingRight || '';
|
2055
|
+
|
2056
|
+
if (this._isBodyOverflowing) {
|
2057
|
+
document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px';
|
2069
2058
|
}
|
2070
|
-
}
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2059
|
+
};
|
2060
|
+
|
2061
|
+
Modal.prototype._resetScrollbar = function _resetScrollbar() {
|
2062
|
+
document.body.style.paddingRight = this._originalBodyPadding;
|
2063
|
+
};
|
2064
|
+
|
2065
|
+
Modal.prototype._getScrollbarWidth = function _getScrollbarWidth() {
|
2066
|
+
// thx d.walsh
|
2067
|
+
var scrollDiv = document.createElement('div');
|
2068
|
+
scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
|
2069
|
+
document.body.appendChild(scrollDiv);
|
2070
|
+
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
2071
|
+
document.body.removeChild(scrollDiv);
|
2072
|
+
return scrollbarWidth;
|
2073
|
+
};
|
2074
|
+
|
2075
|
+
// static
|
2074
2076
|
|
2075
|
-
|
2077
|
+
Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
|
2078
|
+
return this.each(function () {
|
2079
|
+
var data = $(this).data(DATA_KEY);
|
2080
|
+
var _config = $.extend({}, Modal.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
|
2076
2081
|
|
2077
|
-
if (
|
2078
|
-
|
2082
|
+
if (!data) {
|
2083
|
+
data = new Modal(this, _config);
|
2084
|
+
$(this).data(DATA_KEY, data);
|
2079
2085
|
}
|
2080
|
-
}
|
2081
|
-
}, {
|
2082
|
-
key: '_resetScrollbar',
|
2083
|
-
value: function _resetScrollbar() {
|
2084
|
-
document.body.style.paddingRight = this._originalBodyPadding;
|
2085
|
-
}
|
2086
|
-
}, {
|
2087
|
-
key: '_getScrollbarWidth',
|
2088
|
-
value: function _getScrollbarWidth() {
|
2089
|
-
// thx d.walsh
|
2090
|
-
var scrollDiv = document.createElement('div');
|
2091
|
-
scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
|
2092
|
-
document.body.appendChild(scrollDiv);
|
2093
|
-
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
2094
|
-
document.body.removeChild(scrollDiv);
|
2095
|
-
return scrollbarWidth;
|
2096
|
-
}
|
2097
|
-
|
2098
|
-
// static
|
2099
|
-
|
2100
|
-
}], [{
|
2101
|
-
key: '_jQueryInterface',
|
2102
|
-
value: function _jQueryInterface(config, relatedTarget) {
|
2103
|
-
return this.each(function () {
|
2104
|
-
var data = $(this).data(DATA_KEY);
|
2105
|
-
var _config = $.extend({}, Modal.Default, $(this).data(), typeof config === 'object' && config);
|
2106
|
-
|
2107
|
-
if (!data) {
|
2108
|
-
data = new Modal(this, _config);
|
2109
|
-
$(this).data(DATA_KEY, data);
|
2110
|
-
}
|
2111
2086
|
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
}
|
2116
|
-
data[config](relatedTarget);
|
2117
|
-
} else if (_config.show) {
|
2118
|
-
data.show(relatedTarget);
|
2087
|
+
if (typeof config === 'string') {
|
2088
|
+
if (data[config] === undefined) {
|
2089
|
+
throw new Error('No method named "' + config + '"');
|
2119
2090
|
}
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2091
|
+
data[config](relatedTarget);
|
2092
|
+
} else if (_config.show) {
|
2093
|
+
data.show(relatedTarget);
|
2094
|
+
}
|
2095
|
+
});
|
2096
|
+
};
|
2097
|
+
|
2098
|
+
_createClass(Modal, null, [{
|
2123
2099
|
key: 'VERSION',
|
2124
2100
|
get: function get() {
|
2125
2101
|
return VERSION;
|
@@ -2132,12 +2108,18 @@ var Modal = (function ($) {
|
|
2132
2108
|
}]);
|
2133
2109
|
|
2134
2110
|
return Modal;
|
2135
|
-
}
|
2111
|
+
}();
|
2112
|
+
|
2113
|
+
/**
|
2114
|
+
* ------------------------------------------------------------------------
|
2115
|
+
* Data Api implementation
|
2116
|
+
* ------------------------------------------------------------------------
|
2117
|
+
*/
|
2136
2118
|
|
2137
2119
|
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
2138
|
-
var
|
2120
|
+
var _this17 = this;
|
2139
2121
|
|
2140
|
-
var target =
|
2122
|
+
var target = void 0;
|
2141
2123
|
var selector = Util.getSelectorFromElement(this);
|
2142
2124
|
|
2143
2125
|
if (selector) {
|
@@ -2146,7 +2128,7 @@ var Modal = (function ($) {
|
|
2146
2128
|
|
2147
2129
|
var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data());
|
2148
2130
|
|
2149
|
-
if (this.tagName === 'A') {
|
2131
|
+
if (this.tagName === 'A' || this.tagName === 'AREA') {
|
2150
2132
|
event.preventDefault();
|
2151
2133
|
}
|
2152
2134
|
|
@@ -2157,8 +2139,8 @@ var Modal = (function ($) {
|
|
2157
2139
|
}
|
2158
2140
|
|
2159
2141
|
$target.one(Event.HIDDEN, function () {
|
2160
|
-
if ($(
|
2161
|
-
|
2142
|
+
if ($(_this17).is(':visible')) {
|
2143
|
+
_this17.focus();
|
2162
2144
|
}
|
2163
2145
|
});
|
2164
2146
|
});
|
@@ -2180,16 +2162,16 @@ var Modal = (function ($) {
|
|
2180
2162
|
};
|
2181
2163
|
|
2182
2164
|
return Modal;
|
2183
|
-
}
|
2165
|
+
}(jQuery);
|
2184
2166
|
|
2185
2167
|
/**
|
2186
2168
|
* --------------------------------------------------------------------------
|
2187
|
-
* Bootstrap (v4.0.0-alpha.
|
2169
|
+
* Bootstrap (v4.0.0-alpha.6): scrollspy.js
|
2188
2170
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2189
2171
|
* --------------------------------------------------------------------------
|
2190
2172
|
*/
|
2191
2173
|
|
2192
|
-
var ScrollSpy =
|
2174
|
+
var ScrollSpy = function ($) {
|
2193
2175
|
|
2194
2176
|
/**
|
2195
2177
|
* ------------------------------------------------------------------------
|
@@ -2198,7 +2180,7 @@ var ScrollSpy = (function ($) {
|
|
2198
2180
|
*/
|
2199
2181
|
|
2200
2182
|
var NAME = 'scrollspy';
|
2201
|
-
var VERSION = '4.0.0-alpha';
|
2183
|
+
var VERSION = '4.0.0-alpha.6';
|
2202
2184
|
var DATA_KEY = 'bs.scrollspy';
|
2203
2185
|
var EVENT_KEY = '.' + DATA_KEY;
|
2204
2186
|
var DATA_API_KEY = '.data-api';
|
@@ -2253,8 +2235,10 @@ var ScrollSpy = (function ($) {
|
|
2253
2235
|
* ------------------------------------------------------------------------
|
2254
2236
|
*/
|
2255
2237
|
|
2256
|
-
var ScrollSpy =
|
2238
|
+
var ScrollSpy = function () {
|
2257
2239
|
function ScrollSpy(element, config) {
|
2240
|
+
var _this18 = this;
|
2241
|
+
|
2258
2242
|
_classCallCheck(this, ScrollSpy);
|
2259
2243
|
|
2260
2244
|
this._element = element;
|
@@ -2266,197 +2250,187 @@ var ScrollSpy = (function ($) {
|
|
2266
2250
|
this._activeTarget = null;
|
2267
2251
|
this._scrollHeight = 0;
|
2268
2252
|
|
2269
|
-
$(this._scrollElement).on(Event.SCROLL,
|
2253
|
+
$(this._scrollElement).on(Event.SCROLL, function (event) {
|
2254
|
+
return _this18._process(event);
|
2255
|
+
});
|
2270
2256
|
|
2271
2257
|
this.refresh();
|
2272
2258
|
this._process();
|
2273
2259
|
}
|
2274
2260
|
|
2275
|
-
/**
|
2276
|
-
* ------------------------------------------------------------------------
|
2277
|
-
* Data Api implementation
|
2278
|
-
* ------------------------------------------------------------------------
|
2279
|
-
*/
|
2280
|
-
|
2281
2261
|
// getters
|
2282
2262
|
|
2283
|
-
|
2284
|
-
key: 'refresh',
|
2263
|
+
// public
|
2285
2264
|
|
2286
|
-
|
2265
|
+
ScrollSpy.prototype.refresh = function refresh() {
|
2266
|
+
var _this19 = this;
|
2287
2267
|
|
2288
|
-
|
2289
|
-
var _this14 = this;
|
2268
|
+
var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
|
2290
2269
|
|
2291
|
-
|
2270
|
+
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
|
2292
2271
|
|
2293
|
-
|
2272
|
+
var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
|
2294
2273
|
|
2295
|
-
|
2274
|
+
this._offsets = [];
|
2275
|
+
this._targets = [];
|
2296
2276
|
|
2297
|
-
|
2298
|
-
this._targets = [];
|
2277
|
+
this._scrollHeight = this._getScrollHeight();
|
2299
2278
|
|
2300
|
-
|
2279
|
+
var targets = $.makeArray($(this._selector));
|
2301
2280
|
|
2302
|
-
|
2281
|
+
targets.map(function (element) {
|
2282
|
+
var target = void 0;
|
2283
|
+
var targetSelector = Util.getSelectorFromElement(element);
|
2303
2284
|
|
2304
|
-
|
2305
|
-
|
2306
|
-
|
2285
|
+
if (targetSelector) {
|
2286
|
+
target = $(targetSelector)[0];
|
2287
|
+
}
|
2307
2288
|
|
2308
|
-
|
2309
|
-
|
2310
|
-
|
2289
|
+
if (target && (target.offsetWidth || target.offsetHeight)) {
|
2290
|
+
// todo (fat): remove sketch reliance on jQuery position/offset
|
2291
|
+
return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
|
2292
|
+
}
|
2293
|
+
return null;
|
2294
|
+
}).filter(function (item) {
|
2295
|
+
return item;
|
2296
|
+
}).sort(function (a, b) {
|
2297
|
+
return a[0] - b[0];
|
2298
|
+
}).forEach(function (item) {
|
2299
|
+
_this19._offsets.push(item[0]);
|
2300
|
+
_this19._targets.push(item[1]);
|
2301
|
+
});
|
2302
|
+
};
|
2311
2303
|
|
2312
|
-
|
2313
|
-
|
2314
|
-
|
2315
|
-
}
|
2316
|
-
}).filter(function (item) {
|
2317
|
-
return item;
|
2318
|
-
}).sort(function (a, b) {
|
2319
|
-
return a[0] - b[0];
|
2320
|
-
}).forEach(function (item) {
|
2321
|
-
_this14._offsets.push(item[0]);
|
2322
|
-
_this14._targets.push(item[1]);
|
2323
|
-
});
|
2324
|
-
}
|
2325
|
-
}, {
|
2326
|
-
key: 'dispose',
|
2327
|
-
value: function dispose() {
|
2328
|
-
$.removeData(this._element, DATA_KEY);
|
2329
|
-
$(this._scrollElement).off(EVENT_KEY);
|
2330
|
-
|
2331
|
-
this._element = null;
|
2332
|
-
this._scrollElement = null;
|
2333
|
-
this._config = null;
|
2334
|
-
this._selector = null;
|
2335
|
-
this._offsets = null;
|
2336
|
-
this._targets = null;
|
2337
|
-
this._activeTarget = null;
|
2338
|
-
this._scrollHeight = null;
|
2339
|
-
}
|
2304
|
+
ScrollSpy.prototype.dispose = function dispose() {
|
2305
|
+
$.removeData(this._element, DATA_KEY);
|
2306
|
+
$(this._scrollElement).off(EVENT_KEY);
|
2340
2307
|
|
2341
|
-
|
2308
|
+
this._element = null;
|
2309
|
+
this._scrollElement = null;
|
2310
|
+
this._config = null;
|
2311
|
+
this._selector = null;
|
2312
|
+
this._offsets = null;
|
2313
|
+
this._targets = null;
|
2314
|
+
this._activeTarget = null;
|
2315
|
+
this._scrollHeight = null;
|
2316
|
+
};
|
2342
2317
|
|
2343
|
-
|
2344
|
-
key: '_getConfig',
|
2345
|
-
value: function _getConfig(config) {
|
2346
|
-
config = $.extend({}, Default, config);
|
2347
|
-
|
2348
|
-
if (typeof config.target !== 'string') {
|
2349
|
-
var id = $(config.target).attr('id');
|
2350
|
-
if (!id) {
|
2351
|
-
id = Util.getUID(NAME);
|
2352
|
-
$(config.target).attr('id', id);
|
2353
|
-
}
|
2354
|
-
config.target = '#' + id;
|
2355
|
-
}
|
2318
|
+
// private
|
2356
2319
|
|
2357
|
-
|
2320
|
+
ScrollSpy.prototype._getConfig = function _getConfig(config) {
|
2321
|
+
config = $.extend({}, Default, config);
|
2358
2322
|
|
2359
|
-
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2364
|
-
|
2365
|
-
|
2366
|
-
}, {
|
2367
|
-
key: '_getScrollHeight',
|
2368
|
-
value: function _getScrollHeight() {
|
2369
|
-
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
|
2323
|
+
if (typeof config.target !== 'string') {
|
2324
|
+
var id = $(config.target).attr('id');
|
2325
|
+
if (!id) {
|
2326
|
+
id = Util.getUID(NAME);
|
2327
|
+
$(config.target).attr('id', id);
|
2328
|
+
}
|
2329
|
+
config.target = '#' + id;
|
2370
2330
|
}
|
2371
|
-
}, {
|
2372
|
-
key: '_process',
|
2373
|
-
value: function _process() {
|
2374
|
-
var scrollTop = this._getScrollTop() + this._config.offset;
|
2375
|
-
var scrollHeight = this._getScrollHeight();
|
2376
|
-
var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
|
2377
2331
|
|
2378
|
-
|
2379
|
-
this.refresh();
|
2380
|
-
}
|
2332
|
+
Util.typeCheckConfig(NAME, config, DefaultType);
|
2381
2333
|
|
2382
|
-
|
2383
|
-
|
2334
|
+
return config;
|
2335
|
+
};
|
2384
2336
|
|
2385
|
-
|
2386
|
-
|
2387
|
-
|
2388
|
-
}
|
2337
|
+
ScrollSpy.prototype._getScrollTop = function _getScrollTop() {
|
2338
|
+
return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
|
2339
|
+
};
|
2389
2340
|
|
2390
|
-
|
2391
|
-
|
2392
|
-
|
2393
|
-
|
2394
|
-
|
2341
|
+
ScrollSpy.prototype._getScrollHeight = function _getScrollHeight() {
|
2342
|
+
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
|
2343
|
+
};
|
2344
|
+
|
2345
|
+
ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() {
|
2346
|
+
return this._scrollElement === window ? window.innerHeight : this._scrollElement.offsetHeight;
|
2347
|
+
};
|
2395
2348
|
|
2396
|
-
|
2397
|
-
|
2349
|
+
ScrollSpy.prototype._process = function _process() {
|
2350
|
+
var scrollTop = this._getScrollTop() + this._config.offset;
|
2351
|
+
var scrollHeight = this._getScrollHeight();
|
2352
|
+
var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
|
2398
2353
|
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2354
|
+
if (this._scrollHeight !== scrollHeight) {
|
2355
|
+
this.refresh();
|
2356
|
+
}
|
2357
|
+
|
2358
|
+
if (scrollTop >= maxScroll) {
|
2359
|
+
var target = this._targets[this._targets.length - 1];
|
2360
|
+
|
2361
|
+
if (this._activeTarget !== target) {
|
2362
|
+
this._activate(target);
|
2402
2363
|
}
|
2364
|
+
return;
|
2403
2365
|
}
|
2404
|
-
}, {
|
2405
|
-
key: '_activate',
|
2406
|
-
value: function _activate(target) {
|
2407
|
-
this._activeTarget = target;
|
2408
2366
|
|
2367
|
+
if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
|
2368
|
+
this._activeTarget = null;
|
2409
2369
|
this._clear();
|
2370
|
+
return;
|
2371
|
+
}
|
2410
2372
|
|
2411
|
-
|
2412
|
-
|
2413
|
-
return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
|
2414
|
-
});
|
2415
|
-
|
2416
|
-
var $link = $(queries.join(','));
|
2373
|
+
for (var i = this._offsets.length; i--;) {
|
2374
|
+
var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]);
|
2417
2375
|
|
2418
|
-
if (
|
2419
|
-
|
2420
|
-
$link.addClass(ClassName.ACTIVE);
|
2421
|
-
} else {
|
2422
|
-
// todo (fat) this is kinda sus…
|
2423
|
-
// recursively add actives to tested nav-links
|
2424
|
-
$link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
|
2376
|
+
if (isActiveTarget) {
|
2377
|
+
this._activate(this._targets[i]);
|
2425
2378
|
}
|
2426
|
-
|
2427
|
-
$(this._scrollElement).trigger(Event.ACTIVATE, {
|
2428
|
-
relatedTarget: target
|
2429
|
-
});
|
2430
2379
|
}
|
2431
|
-
}
|
2432
|
-
|
2433
|
-
|
2434
|
-
|
2380
|
+
};
|
2381
|
+
|
2382
|
+
ScrollSpy.prototype._activate = function _activate(target) {
|
2383
|
+
this._activeTarget = target;
|
2384
|
+
|
2385
|
+
this._clear();
|
2386
|
+
|
2387
|
+
var queries = this._selector.split(',');
|
2388
|
+
queries = queries.map(function (selector) {
|
2389
|
+
return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
|
2390
|
+
});
|
2391
|
+
|
2392
|
+
var $link = $(queries.join(','));
|
2393
|
+
|
2394
|
+
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
|
2395
|
+
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
2396
|
+
$link.addClass(ClassName.ACTIVE);
|
2397
|
+
} else {
|
2398
|
+
// todo (fat) this is kinda sus...
|
2399
|
+
// recursively add actives to tested nav-links
|
2400
|
+
$link.parents(Selector.LI).find('> ' + Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
|
2435
2401
|
}
|
2436
2402
|
|
2437
|
-
|
2403
|
+
$(this._scrollElement).trigger(Event.ACTIVATE, {
|
2404
|
+
relatedTarget: target
|
2405
|
+
});
|
2406
|
+
};
|
2407
|
+
|
2408
|
+
ScrollSpy.prototype._clear = function _clear() {
|
2409
|
+
$(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
|
2410
|
+
};
|
2438
2411
|
|
2439
|
-
|
2440
|
-
key: '_jQueryInterface',
|
2441
|
-
value: function _jQueryInterface(config) {
|
2442
|
-
return this.each(function () {
|
2443
|
-
var data = $(this).data(DATA_KEY);
|
2444
|
-
var _config = typeof config === 'object' && config || null;
|
2412
|
+
// static
|
2445
2413
|
|
2446
|
-
|
2447
|
-
|
2448
|
-
|
2449
|
-
|
2414
|
+
ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
|
2415
|
+
return this.each(function () {
|
2416
|
+
var data = $(this).data(DATA_KEY);
|
2417
|
+
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config;
|
2450
2418
|
|
2451
|
-
|
2452
|
-
|
2453
|
-
|
2454
|
-
|
2455
|
-
|
2419
|
+
if (!data) {
|
2420
|
+
data = new ScrollSpy(this, _config);
|
2421
|
+
$(this).data(DATA_KEY, data);
|
2422
|
+
}
|
2423
|
+
|
2424
|
+
if (typeof config === 'string') {
|
2425
|
+
if (data[config] === undefined) {
|
2426
|
+
throw new Error('No method named "' + config + '"');
|
2456
2427
|
}
|
2457
|
-
|
2458
|
-
|
2459
|
-
|
2428
|
+
data[config]();
|
2429
|
+
}
|
2430
|
+
});
|
2431
|
+
};
|
2432
|
+
|
2433
|
+
_createClass(ScrollSpy, null, [{
|
2460
2434
|
key: 'VERSION',
|
2461
2435
|
get: function get() {
|
2462
2436
|
return VERSION;
|
@@ -2469,7 +2443,13 @@ var ScrollSpy = (function ($) {
|
|
2469
2443
|
}]);
|
2470
2444
|
|
2471
2445
|
return ScrollSpy;
|
2472
|
-
}
|
2446
|
+
}();
|
2447
|
+
|
2448
|
+
/**
|
2449
|
+
* ------------------------------------------------------------------------
|
2450
|
+
* Data Api implementation
|
2451
|
+
* ------------------------------------------------------------------------
|
2452
|
+
*/
|
2473
2453
|
|
2474
2454
|
$(window).on(Event.LOAD_DATA_API, function () {
|
2475
2455
|
var scrollSpys = $.makeArray($(Selector.DATA_SPY));
|
@@ -2494,16 +2474,16 @@ var ScrollSpy = (function ($) {
|
|
2494
2474
|
};
|
2495
2475
|
|
2496
2476
|
return ScrollSpy;
|
2497
|
-
}
|
2477
|
+
}(jQuery);
|
2498
2478
|
|
2499
2479
|
/**
|
2500
2480
|
* --------------------------------------------------------------------------
|
2501
|
-
* Bootstrap (v4.0.0-alpha.
|
2481
|
+
* Bootstrap (v4.0.0-alpha.6): tab.js
|
2502
2482
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2503
2483
|
* --------------------------------------------------------------------------
|
2504
2484
|
*/
|
2505
2485
|
|
2506
|
-
var Tab =
|
2486
|
+
var Tab = function ($) {
|
2507
2487
|
|
2508
2488
|
/**
|
2509
2489
|
* ------------------------------------------------------------------------
|
@@ -2512,7 +2492,7 @@ var Tab = (function ($) {
|
|
2512
2492
|
*/
|
2513
2493
|
|
2514
2494
|
var NAME = 'tab';
|
2515
|
-
var VERSION = '4.0.0-alpha';
|
2495
|
+
var VERSION = '4.0.0-alpha.6';
|
2516
2496
|
var DATA_KEY = 'bs.tab';
|
2517
2497
|
var EVENT_KEY = '.' + DATA_KEY;
|
2518
2498
|
var DATA_API_KEY = '.data-api';
|
@@ -2530,15 +2510,16 @@ var Tab = (function ($) {
|
|
2530
2510
|
var ClassName = {
|
2531
2511
|
DROPDOWN_MENU: 'dropdown-menu',
|
2532
2512
|
ACTIVE: 'active',
|
2513
|
+
DISABLED: 'disabled',
|
2533
2514
|
FADE: 'fade',
|
2534
|
-
|
2515
|
+
SHOW: 'show'
|
2535
2516
|
};
|
2536
2517
|
|
2537
2518
|
var Selector = {
|
2538
2519
|
A: 'a',
|
2539
2520
|
LI: 'li',
|
2540
2521
|
DROPDOWN: '.dropdown',
|
2541
|
-
|
2522
|
+
LIST: 'ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)',
|
2542
2523
|
FADE_CHILD: '> .nav-item .fade, > .fade',
|
2543
2524
|
ACTIVE: '.active',
|
2544
2525
|
ACTIVE_CHILD: '> .nav-item > .active, > .active',
|
@@ -2553,176 +2534,166 @@ var Tab = (function ($) {
|
|
2553
2534
|
* ------------------------------------------------------------------------
|
2554
2535
|
*/
|
2555
2536
|
|
2556
|
-
var Tab =
|
2537
|
+
var Tab = function () {
|
2557
2538
|
function Tab(element) {
|
2558
2539
|
_classCallCheck(this, Tab);
|
2559
2540
|
|
2560
2541
|
this._element = element;
|
2561
2542
|
}
|
2562
2543
|
|
2563
|
-
/**
|
2564
|
-
* ------------------------------------------------------------------------
|
2565
|
-
* Data Api implementation
|
2566
|
-
* ------------------------------------------------------------------------
|
2567
|
-
*/
|
2568
|
-
|
2569
2544
|
// getters
|
2570
2545
|
|
2571
|
-
|
2572
|
-
|
2546
|
+
// public
|
2547
|
+
|
2548
|
+
Tab.prototype.show = function show() {
|
2549
|
+
var _this20 = this;
|
2550
|
+
|
2551
|
+
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) {
|
2552
|
+
return;
|
2553
|
+
}
|
2573
2554
|
|
2574
|
-
|
2555
|
+
var target = void 0;
|
2556
|
+
var previous = void 0;
|
2557
|
+
var listElement = $(this._element).closest(Selector.LIST)[0];
|
2558
|
+
var selector = Util.getSelectorFromElement(this._element);
|
2575
2559
|
|
2576
|
-
|
2577
|
-
|
2560
|
+
if (listElement) {
|
2561
|
+
previous = $.makeArray($(listElement).find(Selector.ACTIVE));
|
2562
|
+
previous = previous[previous.length - 1];
|
2563
|
+
}
|
2578
2564
|
|
2579
|
-
|
2580
|
-
|
2581
|
-
|
2565
|
+
var hideEvent = $.Event(Event.HIDE, {
|
2566
|
+
relatedTarget: this._element
|
2567
|
+
});
|
2582
2568
|
|
2583
|
-
|
2584
|
-
|
2585
|
-
|
2586
|
-
var selector = Util.getSelectorFromElement(this._element);
|
2569
|
+
var showEvent = $.Event(Event.SHOW, {
|
2570
|
+
relatedTarget: previous
|
2571
|
+
});
|
2587
2572
|
|
2588
|
-
|
2589
|
-
|
2590
|
-
|
2591
|
-
|
2573
|
+
if (previous) {
|
2574
|
+
$(previous).trigger(hideEvent);
|
2575
|
+
}
|
2576
|
+
|
2577
|
+
$(this._element).trigger(showEvent);
|
2578
|
+
|
2579
|
+
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
|
2580
|
+
return;
|
2581
|
+
}
|
2582
|
+
|
2583
|
+
if (selector) {
|
2584
|
+
target = $(selector)[0];
|
2585
|
+
}
|
2586
|
+
|
2587
|
+
this._activate(this._element, listElement);
|
2592
2588
|
|
2593
|
-
|
2594
|
-
|
2589
|
+
var complete = function complete() {
|
2590
|
+
var hiddenEvent = $.Event(Event.HIDDEN, {
|
2591
|
+
relatedTarget: _this20._element
|
2595
2592
|
});
|
2596
2593
|
|
2597
|
-
var
|
2594
|
+
var shownEvent = $.Event(Event.SHOWN, {
|
2598
2595
|
relatedTarget: previous
|
2599
2596
|
});
|
2600
2597
|
|
2601
|
-
|
2602
|
-
|
2603
|
-
|
2604
|
-
|
2605
|
-
$(this._element).trigger(showEvent);
|
2598
|
+
$(previous).trigger(hiddenEvent);
|
2599
|
+
$(_this20._element).trigger(shownEvent);
|
2600
|
+
};
|
2606
2601
|
|
2607
|
-
|
2608
|
-
|
2609
|
-
|
2602
|
+
if (target) {
|
2603
|
+
this._activate(target, target.parentNode, complete);
|
2604
|
+
} else {
|
2605
|
+
complete();
|
2606
|
+
}
|
2607
|
+
};
|
2610
2608
|
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2609
|
+
Tab.prototype.dispose = function dispose() {
|
2610
|
+
$.removeClass(this._element, DATA_KEY);
|
2611
|
+
this._element = null;
|
2612
|
+
};
|
2614
2613
|
|
2615
|
-
|
2614
|
+
// private
|
2616
2615
|
|
2617
|
-
|
2618
|
-
|
2619
|
-
relatedTarget: _this15._element
|
2620
|
-
});
|
2616
|
+
Tab.prototype._activate = function _activate(element, container, callback) {
|
2617
|
+
var _this21 = this;
|
2621
2618
|
|
2622
|
-
|
2623
|
-
|
2624
|
-
});
|
2619
|
+
var active = $(container).find(Selector.ACTIVE_CHILD)[0];
|
2620
|
+
var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
|
2625
2621
|
|
2626
|
-
|
2627
|
-
|
2628
|
-
|
2622
|
+
var complete = function complete() {
|
2623
|
+
return _this21._transitionComplete(element, active, isTransitioning, callback);
|
2624
|
+
};
|
2629
2625
|
|
2630
|
-
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2634
|
-
}
|
2635
|
-
}
|
2636
|
-
}, {
|
2637
|
-
key: 'dispose',
|
2638
|
-
value: function dispose() {
|
2639
|
-
$.removeClass(this._element, DATA_KEY);
|
2640
|
-
this._element = null;
|
2626
|
+
if (active && isTransitioning) {
|
2627
|
+
$(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
2628
|
+
} else {
|
2629
|
+
complete();
|
2641
2630
|
}
|
2642
2631
|
|
2643
|
-
|
2632
|
+
if (active) {
|
2633
|
+
$(active).removeClass(ClassName.SHOW);
|
2634
|
+
}
|
2635
|
+
};
|
2644
2636
|
|
2645
|
-
|
2646
|
-
|
2647
|
-
|
2648
|
-
var active = $(container).find(Selector.ACTIVE_CHILD)[0];
|
2649
|
-
var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
|
2637
|
+
Tab.prototype._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) {
|
2638
|
+
if (active) {
|
2639
|
+
$(active).removeClass(ClassName.ACTIVE);
|
2650
2640
|
|
2651
|
-
var
|
2641
|
+
var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
|
2652
2642
|
|
2653
|
-
if (
|
2654
|
-
$(
|
2655
|
-
} else {
|
2656
|
-
complete();
|
2643
|
+
if (dropdownChild) {
|
2644
|
+
$(dropdownChild).removeClass(ClassName.ACTIVE);
|
2657
2645
|
}
|
2658
2646
|
|
2659
|
-
|
2660
|
-
$(active).removeClass(ClassName.IN);
|
2661
|
-
}
|
2647
|
+
active.setAttribute('aria-expanded', false);
|
2662
2648
|
}
|
2663
|
-
}, {
|
2664
|
-
key: '_transitionComplete',
|
2665
|
-
value: function _transitionComplete(element, active, isTransitioning, callback) {
|
2666
|
-
if (active) {
|
2667
|
-
$(active).removeClass(ClassName.ACTIVE);
|
2668
2649
|
|
2669
|
-
|
2650
|
+
$(element).addClass(ClassName.ACTIVE);
|
2651
|
+
element.setAttribute('aria-expanded', true);
|
2670
2652
|
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2653
|
+
if (isTransitioning) {
|
2654
|
+
Util.reflow(element);
|
2655
|
+
$(element).addClass(ClassName.SHOW);
|
2656
|
+
} else {
|
2657
|
+
$(element).removeClass(ClassName.FADE);
|
2658
|
+
}
|
2674
2659
|
|
2675
|
-
|
2660
|
+
if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
|
2661
|
+
|
2662
|
+
var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
|
2663
|
+
if (dropdownElement) {
|
2664
|
+
$(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
2676
2665
|
}
|
2677
2666
|
|
2678
|
-
$(element).addClass(ClassName.ACTIVE);
|
2679
2667
|
element.setAttribute('aria-expanded', true);
|
2668
|
+
}
|
2680
2669
|
|
2681
|
-
|
2682
|
-
|
2683
|
-
|
2684
|
-
|
2685
|
-
$(element).removeClass(ClassName.FADE);
|
2686
|
-
}
|
2687
|
-
|
2688
|
-
if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
|
2670
|
+
if (callback) {
|
2671
|
+
callback();
|
2672
|
+
}
|
2673
|
+
};
|
2689
2674
|
|
2690
|
-
|
2691
|
-
if (dropdownElement) {
|
2692
|
-
$(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
2693
|
-
}
|
2675
|
+
// static
|
2694
2676
|
|
2695
|
-
|
2696
|
-
|
2677
|
+
Tab._jQueryInterface = function _jQueryInterface(config) {
|
2678
|
+
return this.each(function () {
|
2679
|
+
var $this = $(this);
|
2680
|
+
var data = $this.data(DATA_KEY);
|
2697
2681
|
|
2698
|
-
if (
|
2699
|
-
|
2682
|
+
if (!data) {
|
2683
|
+
data = new Tab(this);
|
2684
|
+
$this.data(DATA_KEY, data);
|
2700
2685
|
}
|
2701
|
-
}
|
2702
|
-
|
2703
|
-
// static
|
2704
|
-
|
2705
|
-
}], [{
|
2706
|
-
key: '_jQueryInterface',
|
2707
|
-
value: function _jQueryInterface(config) {
|
2708
|
-
return this.each(function () {
|
2709
|
-
var $this = $(this);
|
2710
|
-
var data = $this.data(DATA_KEY);
|
2711
2686
|
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2687
|
+
if (typeof config === 'string') {
|
2688
|
+
if (data[config] === undefined) {
|
2689
|
+
throw new Error('No method named "' + config + '"');
|
2715
2690
|
}
|
2691
|
+
data[config]();
|
2692
|
+
}
|
2693
|
+
});
|
2694
|
+
};
|
2716
2695
|
|
2717
|
-
|
2718
|
-
if (data[config] === undefined) {
|
2719
|
-
throw new Error('No method named "' + config + '"');
|
2720
|
-
}
|
2721
|
-
data[config]();
|
2722
|
-
}
|
2723
|
-
});
|
2724
|
-
}
|
2725
|
-
}, {
|
2696
|
+
_createClass(Tab, null, [{
|
2726
2697
|
key: 'VERSION',
|
2727
2698
|
get: function get() {
|
2728
2699
|
return VERSION;
|
@@ -2730,7 +2701,13 @@ var Tab = (function ($) {
|
|
2730
2701
|
}]);
|
2731
2702
|
|
2732
2703
|
return Tab;
|
2733
|
-
}
|
2704
|
+
}();
|
2705
|
+
|
2706
|
+
/**
|
2707
|
+
* ------------------------------------------------------------------------
|
2708
|
+
* Data Api implementation
|
2709
|
+
* ------------------------------------------------------------------------
|
2710
|
+
*/
|
2734
2711
|
|
2735
2712
|
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
2736
2713
|
event.preventDefault();
|
@@ -2751,25 +2728,25 @@ var Tab = (function ($) {
|
|
2751
2728
|
};
|
2752
2729
|
|
2753
2730
|
return Tab;
|
2754
|
-
}
|
2731
|
+
}(jQuery);
|
2755
2732
|
|
2756
2733
|
/* global Tether */
|
2757
2734
|
|
2758
2735
|
/**
|
2759
2736
|
* --------------------------------------------------------------------------
|
2760
|
-
* Bootstrap (v4.0.0-alpha.
|
2737
|
+
* Bootstrap (v4.0.0-alpha.6): tooltip.js
|
2761
2738
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2762
2739
|
* --------------------------------------------------------------------------
|
2763
2740
|
*/
|
2764
2741
|
|
2765
|
-
var Tooltip =
|
2742
|
+
var Tooltip = function ($) {
|
2766
2743
|
|
2767
2744
|
/**
|
2768
2745
|
* Check for Tether dependency
|
2769
|
-
* Tether - http://
|
2746
|
+
* Tether - http://tether.io/
|
2770
2747
|
*/
|
2771
|
-
if (
|
2772
|
-
throw new Error('Bootstrap tooltips require Tether (http://
|
2748
|
+
if (typeof Tether === 'undefined') {
|
2749
|
+
throw new Error('Bootstrap tooltips require Tether (http://tether.io/)');
|
2773
2750
|
}
|
2774
2751
|
|
2775
2752
|
/**
|
@@ -2779,7 +2756,7 @@ var Tooltip = (function ($) {
|
|
2779
2756
|
*/
|
2780
2757
|
|
2781
2758
|
var NAME = 'tooltip';
|
2782
|
-
var VERSION = '4.0.0-alpha';
|
2759
|
+
var VERSION = '4.0.0-alpha.6';
|
2783
2760
|
var DATA_KEY = 'bs.tooltip';
|
2784
2761
|
var EVENT_KEY = '.' + DATA_KEY;
|
2785
2762
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
@@ -2788,7 +2765,7 @@ var Tooltip = (function ($) {
|
|
2788
2765
|
|
2789
2766
|
var Default = {
|
2790
2767
|
animation: true,
|
2791
|
-
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-
|
2768
|
+
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-inner"></div></div>',
|
2792
2769
|
trigger: 'hover focus',
|
2793
2770
|
title: '',
|
2794
2771
|
delay: 0,
|
@@ -2796,7 +2773,8 @@ var Tooltip = (function ($) {
|
|
2796
2773
|
selector: false,
|
2797
2774
|
placement: 'top',
|
2798
2775
|
offset: '0 0',
|
2799
|
-
constraints: []
|
2776
|
+
constraints: [],
|
2777
|
+
container: false
|
2800
2778
|
};
|
2801
2779
|
|
2802
2780
|
var DefaultType = {
|
@@ -2809,7 +2787,8 @@ var Tooltip = (function ($) {
|
|
2809
2787
|
selector: '(string|boolean)',
|
2810
2788
|
placement: '(string|function)',
|
2811
2789
|
offset: 'string',
|
2812
|
-
constraints: 'array'
|
2790
|
+
constraints: 'array',
|
2791
|
+
container: '(string|element|boolean)'
|
2813
2792
|
};
|
2814
2793
|
|
2815
2794
|
var AttachmentMap = {
|
@@ -2820,7 +2799,7 @@ var Tooltip = (function ($) {
|
|
2820
2799
|
};
|
2821
2800
|
|
2822
2801
|
var HoverState = {
|
2823
|
-
|
2802
|
+
SHOW: 'show',
|
2824
2803
|
OUT: 'out'
|
2825
2804
|
};
|
2826
2805
|
|
@@ -2839,7 +2818,7 @@ var Tooltip = (function ($) {
|
|
2839
2818
|
|
2840
2819
|
var ClassName = {
|
2841
2820
|
FADE: 'fade',
|
2842
|
-
|
2821
|
+
SHOW: 'show'
|
2843
2822
|
};
|
2844
2823
|
|
2845
2824
|
var Selector = {
|
@@ -2865,7 +2844,7 @@ var Tooltip = (function ($) {
|
|
2865
2844
|
* ------------------------------------------------------------------------
|
2866
2845
|
*/
|
2867
2846
|
|
2868
|
-
var Tooltip =
|
2847
|
+
var Tooltip = function () {
|
2869
2848
|
function Tooltip(element, config) {
|
2870
2849
|
_classCallCheck(this, Tooltip);
|
2871
2850
|
|
@@ -2874,6 +2853,7 @@ var Tooltip = (function ($) {
|
|
2874
2853
|
this._timeout = 0;
|
2875
2854
|
this._hoverState = '';
|
2876
2855
|
this._activeTrigger = {};
|
2856
|
+
this._isTransitioning = false;
|
2877
2857
|
this._tether = null;
|
2878
2858
|
|
2879
2859
|
// protected
|
@@ -2884,439 +2864,436 @@ var Tooltip = (function ($) {
|
|
2884
2864
|
this._setListeners();
|
2885
2865
|
}
|
2886
2866
|
|
2887
|
-
/**
|
2888
|
-
* ------------------------------------------------------------------------
|
2889
|
-
* jQuery
|
2890
|
-
* ------------------------------------------------------------------------
|
2891
|
-
*/
|
2892
|
-
|
2893
2867
|
// getters
|
2894
2868
|
|
2895
|
-
|
2896
|
-
key: 'enable',
|
2869
|
+
// public
|
2897
2870
|
|
2898
|
-
|
2871
|
+
Tooltip.prototype.enable = function enable() {
|
2872
|
+
this._isEnabled = true;
|
2873
|
+
};
|
2899
2874
|
|
2900
|
-
|
2901
|
-
|
2902
|
-
|
2903
|
-
}, {
|
2904
|
-
key: 'disable',
|
2905
|
-
value: function disable() {
|
2906
|
-
this._isEnabled = false;
|
2907
|
-
}
|
2908
|
-
}, {
|
2909
|
-
key: 'toggleEnabled',
|
2910
|
-
value: function toggleEnabled() {
|
2911
|
-
this._isEnabled = !this._isEnabled;
|
2912
|
-
}
|
2913
|
-
}, {
|
2914
|
-
key: 'toggle',
|
2915
|
-
value: function toggle(event) {
|
2916
|
-
if (event) {
|
2917
|
-
var dataKey = this.constructor.DATA_KEY;
|
2918
|
-
var context = $(event.currentTarget).data(dataKey);
|
2875
|
+
Tooltip.prototype.disable = function disable() {
|
2876
|
+
this._isEnabled = false;
|
2877
|
+
};
|
2919
2878
|
|
2920
|
-
|
2921
|
-
|
2922
|
-
|
2923
|
-
}
|
2879
|
+
Tooltip.prototype.toggleEnabled = function toggleEnabled() {
|
2880
|
+
this._isEnabled = !this._isEnabled;
|
2881
|
+
};
|
2924
2882
|
|
2925
|
-
|
2883
|
+
Tooltip.prototype.toggle = function toggle(event) {
|
2884
|
+
if (event) {
|
2885
|
+
var dataKey = this.constructor.DATA_KEY;
|
2886
|
+
var context = $(event.currentTarget).data(dataKey);
|
2926
2887
|
|
2927
|
-
|
2928
|
-
|
2929
|
-
|
2930
|
-
|
2931
|
-
}
|
2932
|
-
} else {
|
2888
|
+
if (!context) {
|
2889
|
+
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
2890
|
+
$(event.currentTarget).data(dataKey, context);
|
2891
|
+
}
|
2933
2892
|
|
2934
|
-
|
2935
|
-
this._leave(null, this);
|
2936
|
-
return;
|
2937
|
-
}
|
2893
|
+
context._activeTrigger.click = !context._activeTrigger.click;
|
2938
2894
|
|
2939
|
-
|
2895
|
+
if (context._isWithActiveTrigger()) {
|
2896
|
+
context._enter(null, context);
|
2897
|
+
} else {
|
2898
|
+
context._leave(null, context);
|
2940
2899
|
}
|
2941
|
-
}
|
2942
|
-
}, {
|
2943
|
-
key: 'dispose',
|
2944
|
-
value: function dispose() {
|
2945
|
-
clearTimeout(this._timeout);
|
2900
|
+
} else {
|
2946
2901
|
|
2947
|
-
this.
|
2902
|
+
if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
|
2903
|
+
this._leave(null, this);
|
2904
|
+
return;
|
2905
|
+
}
|
2948
2906
|
|
2949
|
-
|
2907
|
+
this._enter(null, this);
|
2908
|
+
}
|
2909
|
+
};
|
2950
2910
|
|
2951
|
-
|
2911
|
+
Tooltip.prototype.dispose = function dispose() {
|
2912
|
+
clearTimeout(this._timeout);
|
2952
2913
|
|
2953
|
-
|
2954
|
-
$(this.tip).remove();
|
2955
|
-
}
|
2914
|
+
this.cleanupTether();
|
2956
2915
|
|
2957
|
-
|
2958
|
-
this._timeout = null;
|
2959
|
-
this._hoverState = null;
|
2960
|
-
this._activeTrigger = null;
|
2961
|
-
this._tether = null;
|
2916
|
+
$.removeData(this.element, this.constructor.DATA_KEY);
|
2962
2917
|
|
2963
|
-
|
2964
|
-
|
2965
|
-
this.tip = null;
|
2966
|
-
}
|
2967
|
-
}, {
|
2968
|
-
key: 'show',
|
2969
|
-
value: function show() {
|
2970
|
-
var _this16 = this;
|
2918
|
+
$(this.element).off(this.constructor.EVENT_KEY);
|
2919
|
+
$(this.element).closest('.modal').off('hide.bs.modal');
|
2971
2920
|
|
2972
|
-
|
2921
|
+
if (this.tip) {
|
2922
|
+
$(this.tip).remove();
|
2923
|
+
}
|
2973
2924
|
|
2974
|
-
|
2975
|
-
|
2925
|
+
this._isEnabled = null;
|
2926
|
+
this._timeout = null;
|
2927
|
+
this._hoverState = null;
|
2928
|
+
this._activeTrigger = null;
|
2929
|
+
this._tether = null;
|
2976
2930
|
|
2977
|
-
|
2931
|
+
this.element = null;
|
2932
|
+
this.config = null;
|
2933
|
+
this.tip = null;
|
2934
|
+
};
|
2978
2935
|
|
2979
|
-
|
2980
|
-
|
2981
|
-
}
|
2936
|
+
Tooltip.prototype.show = function show() {
|
2937
|
+
var _this22 = this;
|
2982
2938
|
|
2983
|
-
|
2984
|
-
|
2939
|
+
if ($(this.element).css('display') === 'none') {
|
2940
|
+
throw new Error('Please use show on visible elements');
|
2941
|
+
}
|
2985
2942
|
|
2986
|
-
|
2987
|
-
|
2943
|
+
var showEvent = $.Event(this.constructor.Event.SHOW);
|
2944
|
+
if (this.isWithContent() && this._isEnabled) {
|
2945
|
+
if (this._isTransitioning) {
|
2946
|
+
throw new Error('Tooltip is transitioning');
|
2947
|
+
}
|
2948
|
+
$(this.element).trigger(showEvent);
|
2988
2949
|
|
2989
|
-
|
2950
|
+
var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
|
2990
2951
|
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2952
|
+
if (showEvent.isDefaultPrevented() || !isInTheDom) {
|
2953
|
+
return;
|
2954
|
+
}
|
2994
2955
|
|
2995
|
-
|
2956
|
+
var tip = this.getTipElement();
|
2957
|
+
var tipId = Util.getUID(this.constructor.NAME);
|
2996
2958
|
|
2997
|
-
|
2959
|
+
tip.setAttribute('id', tipId);
|
2960
|
+
this.element.setAttribute('aria-describedby', tipId);
|
2998
2961
|
|
2999
|
-
|
2962
|
+
this.setContent();
|
3000
2963
|
|
3001
|
-
|
2964
|
+
if (this.config.animation) {
|
2965
|
+
$(tip).addClass(ClassName.FADE);
|
2966
|
+
}
|
3002
2967
|
|
3003
|
-
|
3004
|
-
attachment: attachment,
|
3005
|
-
element: tip,
|
3006
|
-
target: this.element,
|
3007
|
-
classes: TetherClass,
|
3008
|
-
classPrefix: CLASS_PREFIX,
|
3009
|
-
offset: this.config.offset,
|
3010
|
-
constraints: this.config.constraints,
|
3011
|
-
addTargetClasses: false
|
3012
|
-
});
|
2968
|
+
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
3013
2969
|
|
3014
|
-
|
3015
|
-
this._tether.position();
|
2970
|
+
var attachment = this._getAttachment(placement);
|
3016
2971
|
|
3017
|
-
|
2972
|
+
var container = this.config.container === false ? document.body : $(this.config.container);
|
3018
2973
|
|
3019
|
-
|
3020
|
-
var prevHoverState = _this16._hoverState;
|
3021
|
-
_this16._hoverState = null;
|
2974
|
+
$(tip).data(this.constructor.DATA_KEY, this).appendTo(container);
|
3022
2975
|
|
3023
|
-
|
2976
|
+
$(this.element).trigger(this.constructor.Event.INSERTED);
|
3024
2977
|
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
2978
|
+
this._tether = new Tether({
|
2979
|
+
attachment: attachment,
|
2980
|
+
element: tip,
|
2981
|
+
target: this.element,
|
2982
|
+
classes: TetherClass,
|
2983
|
+
classPrefix: CLASS_PREFIX,
|
2984
|
+
offset: this.config.offset,
|
2985
|
+
constraints: this.config.constraints,
|
2986
|
+
addTargetClasses: false
|
2987
|
+
});
|
3029
2988
|
|
3030
|
-
|
3031
|
-
|
3032
|
-
return;
|
3033
|
-
}
|
2989
|
+
Util.reflow(tip);
|
2990
|
+
this._tether.position();
|
3034
2991
|
|
3035
|
-
|
3036
|
-
}
|
3037
|
-
}
|
3038
|
-
}, {
|
3039
|
-
key: 'hide',
|
3040
|
-
value: function hide(callback) {
|
3041
|
-
var _this17 = this;
|
2992
|
+
$(tip).addClass(ClassName.SHOW);
|
3042
2993
|
|
3043
|
-
var tip = this.getTipElement();
|
3044
|
-
var hideEvent = $.Event(this.constructor.Event.HIDE);
|
3045
2994
|
var complete = function complete() {
|
3046
|
-
|
3047
|
-
|
3048
|
-
|
2995
|
+
var prevHoverState = _this22._hoverState;
|
2996
|
+
_this22._hoverState = null;
|
2997
|
+
_this22._isTransitioning = false;
|
3049
2998
|
|
3050
|
-
|
3051
|
-
$(_this17.element).trigger(_this17.constructor.Event.HIDDEN);
|
3052
|
-
_this17.cleanupTether();
|
2999
|
+
$(_this22.element).trigger(_this22.constructor.Event.SHOWN);
|
3053
3000
|
|
3054
|
-
if (
|
3055
|
-
|
3001
|
+
if (prevHoverState === HoverState.OUT) {
|
3002
|
+
_this22._leave(null, _this22);
|
3056
3003
|
}
|
3057
3004
|
};
|
3058
3005
|
|
3059
|
-
$(this.
|
3060
|
-
|
3061
|
-
|
3006
|
+
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
|
3007
|
+
this._isTransitioning = true;
|
3008
|
+
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
|
3062
3009
|
return;
|
3063
3010
|
}
|
3064
3011
|
|
3065
|
-
|
3012
|
+
complete();
|
3013
|
+
}
|
3014
|
+
};
|
3066
3015
|
|
3067
|
-
|
3016
|
+
Tooltip.prototype.hide = function hide(callback) {
|
3017
|
+
var _this23 = this;
|
3068
3018
|
|
3069
|
-
|
3070
|
-
|
3071
|
-
|
3019
|
+
var tip = this.getTipElement();
|
3020
|
+
var hideEvent = $.Event(this.constructor.Event.HIDE);
|
3021
|
+
if (this._isTransitioning) {
|
3022
|
+
throw new Error('Tooltip is transitioning');
|
3023
|
+
}
|
3024
|
+
var complete = function complete() {
|
3025
|
+
if (_this23._hoverState !== HoverState.SHOW && tip.parentNode) {
|
3026
|
+
tip.parentNode.removeChild(tip);
|
3072
3027
|
}
|
3073
3028
|
|
3074
|
-
|
3075
|
-
|
3029
|
+
_this23.element.removeAttribute('aria-describedby');
|
3030
|
+
$(_this23.element).trigger(_this23.constructor.Event.HIDDEN);
|
3031
|
+
_this23._isTransitioning = false;
|
3032
|
+
_this23.cleanupTether();
|
3076
3033
|
|
3077
|
-
|
3034
|
+
if (callback) {
|
3035
|
+
callback();
|
3036
|
+
}
|
3037
|
+
};
|
3078
3038
|
|
3079
|
-
|
3080
|
-
|
3081
|
-
|
3082
|
-
return
|
3083
|
-
}
|
3084
|
-
}, {
|
3085
|
-
key: 'getTipElement',
|
3086
|
-
value: function getTipElement() {
|
3087
|
-
return this.tip = this.tip || $(this.config.template)[0];
|
3039
|
+
$(this.element).trigger(hideEvent);
|
3040
|
+
|
3041
|
+
if (hideEvent.isDefaultPrevented()) {
|
3042
|
+
return;
|
3088
3043
|
}
|
3089
|
-
}, {
|
3090
|
-
key: 'setContent',
|
3091
|
-
value: function setContent() {
|
3092
|
-
var $tip = $(this.getTipElement());
|
3093
3044
|
|
3094
|
-
|
3045
|
+
$(tip).removeClass(ClassName.SHOW);
|
3095
3046
|
|
3096
|
-
|
3047
|
+
this._activeTrigger[Trigger.CLICK] = false;
|
3048
|
+
this._activeTrigger[Trigger.FOCUS] = false;
|
3049
|
+
this._activeTrigger[Trigger.HOVER] = false;
|
3097
3050
|
|
3098
|
-
|
3051
|
+
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
|
3052
|
+
this._isTransitioning = true;
|
3053
|
+
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
3054
|
+
} else {
|
3055
|
+
complete();
|
3099
3056
|
}
|
3100
|
-
|
3101
|
-
|
3102
|
-
|
3103
|
-
|
3104
|
-
|
3105
|
-
|
3106
|
-
|
3107
|
-
|
3108
|
-
|
3109
|
-
|
3110
|
-
|
3111
|
-
|
3057
|
+
|
3058
|
+
this._hoverState = '';
|
3059
|
+
};
|
3060
|
+
|
3061
|
+
// protected
|
3062
|
+
|
3063
|
+
Tooltip.prototype.isWithContent = function isWithContent() {
|
3064
|
+
return Boolean(this.getTitle());
|
3065
|
+
};
|
3066
|
+
|
3067
|
+
Tooltip.prototype.getTipElement = function getTipElement() {
|
3068
|
+
return this.tip = this.tip || $(this.config.template)[0];
|
3069
|
+
};
|
3070
|
+
|
3071
|
+
Tooltip.prototype.setContent = function setContent() {
|
3072
|
+
var $tip = $(this.getTipElement());
|
3073
|
+
|
3074
|
+
this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
|
3075
|
+
|
3076
|
+
$tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW);
|
3077
|
+
|
3078
|
+
this.cleanupTether();
|
3079
|
+
};
|
3080
|
+
|
3081
|
+
Tooltip.prototype.setElementContent = function setElementContent($element, content) {
|
3082
|
+
var html = this.config.html;
|
3083
|
+
if ((typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && (content.nodeType || content.jquery)) {
|
3084
|
+
// content is a DOM node or a jQuery
|
3085
|
+
if (html) {
|
3086
|
+
if (!$(content).parent().is($element)) {
|
3087
|
+
$element.empty().append(content);
|
3112
3088
|
}
|
3113
3089
|
} else {
|
3114
|
-
$element
|
3090
|
+
$element.text($(content).text());
|
3115
3091
|
}
|
3092
|
+
} else {
|
3093
|
+
$element[html ? 'html' : 'text'](content);
|
3116
3094
|
}
|
3117
|
-
}
|
3118
|
-
key: 'getTitle',
|
3119
|
-
value: function getTitle() {
|
3120
|
-
var title = this.element.getAttribute('data-original-title');
|
3095
|
+
};
|
3121
3096
|
|
3122
|
-
|
3123
|
-
|
3124
|
-
}
|
3097
|
+
Tooltip.prototype.getTitle = function getTitle() {
|
3098
|
+
var title = this.element.getAttribute('data-original-title');
|
3125
3099
|
|
3126
|
-
|
3127
|
-
|
3128
|
-
}, {
|
3129
|
-
key: 'cleanupTether',
|
3130
|
-
value: function cleanupTether() {
|
3131
|
-
if (this._tether) {
|
3132
|
-
this._tether.destroy();
|
3133
|
-
}
|
3100
|
+
if (!title) {
|
3101
|
+
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
|
3134
3102
|
}
|
3135
3103
|
|
3136
|
-
|
3104
|
+
return title;
|
3105
|
+
};
|
3137
3106
|
|
3138
|
-
|
3139
|
-
|
3140
|
-
|
3141
|
-
return AttachmentMap[placement.toUpperCase()];
|
3107
|
+
Tooltip.prototype.cleanupTether = function cleanupTether() {
|
3108
|
+
if (this._tether) {
|
3109
|
+
this._tether.destroy();
|
3142
3110
|
}
|
3143
|
-
}
|
3144
|
-
key: '_setListeners',
|
3145
|
-
value: function _setListeners() {
|
3146
|
-
var _this18 = this;
|
3111
|
+
};
|
3147
3112
|
|
3148
|
-
|
3113
|
+
// private
|
3149
3114
|
|
3150
|
-
|
3151
|
-
|
3152
|
-
|
3153
|
-
} else if (trigger !== Trigger.MANUAL) {
|
3154
|
-
var eventIn = trigger === Trigger.HOVER ? _this18.constructor.Event.MOUSEENTER : _this18.constructor.Event.FOCUSIN;
|
3155
|
-
var eventOut = trigger === Trigger.HOVER ? _this18.constructor.Event.MOUSELEAVE : _this18.constructor.Event.FOCUSOUT;
|
3115
|
+
Tooltip.prototype._getAttachment = function _getAttachment(placement) {
|
3116
|
+
return AttachmentMap[placement.toUpperCase()];
|
3117
|
+
};
|
3156
3118
|
|
3157
|
-
|
3158
|
-
|
3159
|
-
});
|
3119
|
+
Tooltip.prototype._setListeners = function _setListeners() {
|
3120
|
+
var _this24 = this;
|
3160
3121
|
|
3161
|
-
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3122
|
+
var triggers = this.config.trigger.split(' ');
|
3123
|
+
|
3124
|
+
triggers.forEach(function (trigger) {
|
3125
|
+
if (trigger === 'click') {
|
3126
|
+
$(_this24.element).on(_this24.constructor.Event.CLICK, _this24.config.selector, function (event) {
|
3127
|
+
return _this24.toggle(event);
|
3128
|
+
});
|
3129
|
+
} else if (trigger !== Trigger.MANUAL) {
|
3130
|
+
var eventIn = trigger === Trigger.HOVER ? _this24.constructor.Event.MOUSEENTER : _this24.constructor.Event.FOCUSIN;
|
3131
|
+
var eventOut = trigger === Trigger.HOVER ? _this24.constructor.Event.MOUSELEAVE : _this24.constructor.Event.FOCUSOUT;
|
3132
|
+
|
3133
|
+
$(_this24.element).on(eventIn, _this24.config.selector, function (event) {
|
3134
|
+
return _this24._enter(event);
|
3135
|
+
}).on(eventOut, _this24.config.selector, function (event) {
|
3136
|
+
return _this24._leave(event);
|
3165
3137
|
});
|
3166
|
-
} else {
|
3167
|
-
this._fixTitle();
|
3168
3138
|
}
|
3139
|
+
|
3140
|
+
$(_this24.element).closest('.modal').on('hide.bs.modal', function () {
|
3141
|
+
return _this24.hide();
|
3142
|
+
});
|
3143
|
+
});
|
3144
|
+
|
3145
|
+
if (this.config.selector) {
|
3146
|
+
this.config = $.extend({}, this.config, {
|
3147
|
+
trigger: 'manual',
|
3148
|
+
selector: ''
|
3149
|
+
});
|
3150
|
+
} else {
|
3151
|
+
this._fixTitle();
|
3169
3152
|
}
|
3170
|
-
}
|
3171
|
-
|
3172
|
-
|
3173
|
-
|
3174
|
-
|
3175
|
-
|
3176
|
-
|
3177
|
-
}
|
3153
|
+
};
|
3154
|
+
|
3155
|
+
Tooltip.prototype._fixTitle = function _fixTitle() {
|
3156
|
+
var titleType = _typeof(this.element.getAttribute('data-original-title'));
|
3157
|
+
if (this.element.getAttribute('title') || titleType !== 'string') {
|
3158
|
+
this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
|
3159
|
+
this.element.setAttribute('title', '');
|
3178
3160
|
}
|
3179
|
-
}
|
3180
|
-
key: '_enter',
|
3181
|
-
value: function _enter(event, context) {
|
3182
|
-
var dataKey = this.constructor.DATA_KEY;
|
3161
|
+
};
|
3183
3162
|
|
3184
|
-
|
3163
|
+
Tooltip.prototype._enter = function _enter(event, context) {
|
3164
|
+
var dataKey = this.constructor.DATA_KEY;
|
3185
3165
|
|
3186
|
-
|
3187
|
-
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
3188
|
-
$(event.currentTarget).data(dataKey, context);
|
3189
|
-
}
|
3166
|
+
context = context || $(event.currentTarget).data(dataKey);
|
3190
3167
|
|
3191
|
-
|
3192
|
-
|
3193
|
-
|
3168
|
+
if (!context) {
|
3169
|
+
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
3170
|
+
$(event.currentTarget).data(dataKey, context);
|
3171
|
+
}
|
3194
3172
|
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3173
|
+
if (event) {
|
3174
|
+
context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
|
3175
|
+
}
|
3176
|
+
|
3177
|
+
if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
|
3178
|
+
context._hoverState = HoverState.SHOW;
|
3179
|
+
return;
|
3180
|
+
}
|
3199
3181
|
|
3200
|
-
|
3182
|
+
clearTimeout(context._timeout);
|
3201
3183
|
|
3202
|
-
|
3184
|
+
context._hoverState = HoverState.SHOW;
|
3203
3185
|
|
3204
|
-
|
3186
|
+
if (!context.config.delay || !context.config.delay.show) {
|
3187
|
+
context.show();
|
3188
|
+
return;
|
3189
|
+
}
|
3190
|
+
|
3191
|
+
context._timeout = setTimeout(function () {
|
3192
|
+
if (context._hoverState === HoverState.SHOW) {
|
3205
3193
|
context.show();
|
3206
|
-
return;
|
3207
3194
|
}
|
3195
|
+
}, context.config.delay.show);
|
3196
|
+
};
|
3208
3197
|
|
3209
|
-
|
3210
|
-
|
3211
|
-
context.show();
|
3212
|
-
}
|
3213
|
-
}, context.config.delay.show);
|
3214
|
-
}
|
3215
|
-
}, {
|
3216
|
-
key: '_leave',
|
3217
|
-
value: function _leave(event, context) {
|
3218
|
-
var dataKey = this.constructor.DATA_KEY;
|
3198
|
+
Tooltip.prototype._leave = function _leave(event, context) {
|
3199
|
+
var dataKey = this.constructor.DATA_KEY;
|
3219
3200
|
|
3220
|
-
|
3201
|
+
context = context || $(event.currentTarget).data(dataKey);
|
3221
3202
|
|
3222
|
-
|
3223
|
-
|
3224
|
-
|
3225
|
-
|
3203
|
+
if (!context) {
|
3204
|
+
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
3205
|
+
$(event.currentTarget).data(dataKey, context);
|
3206
|
+
}
|
3226
3207
|
|
3227
|
-
|
3228
|
-
|
3229
|
-
|
3208
|
+
if (event) {
|
3209
|
+
context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
|
3210
|
+
}
|
3230
3211
|
|
3231
|
-
|
3232
|
-
|
3233
|
-
|
3212
|
+
if (context._isWithActiveTrigger()) {
|
3213
|
+
return;
|
3214
|
+
}
|
3234
3215
|
|
3235
|
-
|
3216
|
+
clearTimeout(context._timeout);
|
3236
3217
|
|
3237
|
-
|
3218
|
+
context._hoverState = HoverState.OUT;
|
3219
|
+
|
3220
|
+
if (!context.config.delay || !context.config.delay.hide) {
|
3221
|
+
context.hide();
|
3222
|
+
return;
|
3223
|
+
}
|
3238
3224
|
|
3239
|
-
|
3225
|
+
context._timeout = setTimeout(function () {
|
3226
|
+
if (context._hoverState === HoverState.OUT) {
|
3240
3227
|
context.hide();
|
3241
|
-
return;
|
3242
3228
|
}
|
3229
|
+
}, context.config.delay.hide);
|
3230
|
+
};
|
3243
3231
|
|
3244
|
-
|
3245
|
-
|
3246
|
-
|
3247
|
-
|
3248
|
-
}, context.config.delay.hide);
|
3249
|
-
}
|
3250
|
-
}, {
|
3251
|
-
key: '_isWithActiveTrigger',
|
3252
|
-
value: function _isWithActiveTrigger() {
|
3253
|
-
for (var trigger in this._activeTrigger) {
|
3254
|
-
if (this._activeTrigger[trigger]) {
|
3255
|
-
return true;
|
3256
|
-
}
|
3232
|
+
Tooltip.prototype._isWithActiveTrigger = function _isWithActiveTrigger() {
|
3233
|
+
for (var trigger in this._activeTrigger) {
|
3234
|
+
if (this._activeTrigger[trigger]) {
|
3235
|
+
return true;
|
3257
3236
|
}
|
3258
|
-
|
3259
|
-
return false;
|
3260
3237
|
}
|
3261
|
-
}, {
|
3262
|
-
key: '_getConfig',
|
3263
|
-
value: function _getConfig(config) {
|
3264
|
-
config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
|
3265
3238
|
|
3266
|
-
|
3267
|
-
|
3268
|
-
show: config.delay,
|
3269
|
-
hide: config.delay
|
3270
|
-
};
|
3271
|
-
}
|
3239
|
+
return false;
|
3240
|
+
};
|
3272
3241
|
|
3273
|
-
|
3242
|
+
Tooltip.prototype._getConfig = function _getConfig(config) {
|
3243
|
+
config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
|
3274
3244
|
|
3275
|
-
|
3245
|
+
if (config.delay && typeof config.delay === 'number') {
|
3246
|
+
config.delay = {
|
3247
|
+
show: config.delay,
|
3248
|
+
hide: config.delay
|
3249
|
+
};
|
3276
3250
|
}
|
3277
|
-
|
3278
|
-
|
3279
|
-
|
3280
|
-
|
3281
|
-
|
3282
|
-
|
3283
|
-
|
3284
|
-
|
3285
|
-
|
3286
|
-
|
3251
|
+
|
3252
|
+
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
3253
|
+
|
3254
|
+
return config;
|
3255
|
+
};
|
3256
|
+
|
3257
|
+
Tooltip.prototype._getDelegateConfig = function _getDelegateConfig() {
|
3258
|
+
var config = {};
|
3259
|
+
|
3260
|
+
if (this.config) {
|
3261
|
+
for (var key in this.config) {
|
3262
|
+
if (this.constructor.Default[key] !== this.config[key]) {
|
3263
|
+
config[key] = this.config[key];
|
3287
3264
|
}
|
3288
3265
|
}
|
3289
|
-
|
3290
|
-
return config;
|
3291
3266
|
}
|
3292
3267
|
|
3293
|
-
|
3268
|
+
return config;
|
3269
|
+
};
|
3294
3270
|
|
3295
|
-
|
3296
|
-
key: '_jQueryInterface',
|
3297
|
-
value: function _jQueryInterface(config) {
|
3298
|
-
return this.each(function () {
|
3299
|
-
var data = $(this).data(DATA_KEY);
|
3300
|
-
var _config = typeof config === 'object' ? config : null;
|
3271
|
+
// static
|
3301
3272
|
|
3302
|
-
|
3303
|
-
|
3304
|
-
|
3273
|
+
Tooltip._jQueryInterface = function _jQueryInterface(config) {
|
3274
|
+
return this.each(function () {
|
3275
|
+
var data = $(this).data(DATA_KEY);
|
3276
|
+
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config;
|
3305
3277
|
|
3306
|
-
|
3307
|
-
|
3308
|
-
|
3309
|
-
}
|
3278
|
+
if (!data && /dispose|hide/.test(config)) {
|
3279
|
+
return;
|
3280
|
+
}
|
3310
3281
|
|
3311
|
-
|
3312
|
-
|
3313
|
-
|
3314
|
-
|
3315
|
-
|
3282
|
+
if (!data) {
|
3283
|
+
data = new Tooltip(this, _config);
|
3284
|
+
$(this).data(DATA_KEY, data);
|
3285
|
+
}
|
3286
|
+
|
3287
|
+
if (typeof config === 'string') {
|
3288
|
+
if (data[config] === undefined) {
|
3289
|
+
throw new Error('No method named "' + config + '"');
|
3316
3290
|
}
|
3317
|
-
|
3318
|
-
|
3319
|
-
|
3291
|
+
data[config]();
|
3292
|
+
}
|
3293
|
+
});
|
3294
|
+
};
|
3295
|
+
|
3296
|
+
_createClass(Tooltip, null, [{
|
3320
3297
|
key: 'VERSION',
|
3321
3298
|
get: function get() {
|
3322
3299
|
return VERSION;
|
@@ -3354,7 +3331,13 @@ var Tooltip = (function ($) {
|
|
3354
3331
|
}]);
|
3355
3332
|
|
3356
3333
|
return Tooltip;
|
3357
|
-
}
|
3334
|
+
}();
|
3335
|
+
|
3336
|
+
/**
|
3337
|
+
* ------------------------------------------------------------------------
|
3338
|
+
* jQuery
|
3339
|
+
* ------------------------------------------------------------------------
|
3340
|
+
*/
|
3358
3341
|
|
3359
3342
|
$.fn[NAME] = Tooltip._jQueryInterface;
|
3360
3343
|
$.fn[NAME].Constructor = Tooltip;
|
@@ -3364,16 +3347,16 @@ var Tooltip = (function ($) {
|
|
3364
3347
|
};
|
3365
3348
|
|
3366
3349
|
return Tooltip;
|
3367
|
-
}
|
3350
|
+
}(jQuery);
|
3368
3351
|
|
3369
3352
|
/**
|
3370
3353
|
* --------------------------------------------------------------------------
|
3371
|
-
* Bootstrap (v4.0.0-alpha.
|
3354
|
+
* Bootstrap (v4.0.0-alpha.6): popover.js
|
3372
3355
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
3373
3356
|
* --------------------------------------------------------------------------
|
3374
3357
|
*/
|
3375
3358
|
|
3376
|
-
var Popover =
|
3359
|
+
var Popover = function ($) {
|
3377
3360
|
|
3378
3361
|
/**
|
3379
3362
|
* ------------------------------------------------------------------------
|
@@ -3382,7 +3365,7 @@ var Popover = (function ($) {
|
|
3382
3365
|
*/
|
3383
3366
|
|
3384
3367
|
var NAME = 'popover';
|
3385
|
-
var VERSION = '4.0.0-alpha';
|
3368
|
+
var VERSION = '4.0.0-alpha.6';
|
3386
3369
|
var DATA_KEY = 'bs.popover';
|
3387
3370
|
var EVENT_KEY = '.' + DATA_KEY;
|
3388
3371
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
@@ -3391,7 +3374,7 @@ var Popover = (function ($) {
|
|
3391
3374
|
placement: 'right',
|
3392
3375
|
trigger: 'click',
|
3393
3376
|
content: '',
|
3394
|
-
template: '<div class="popover" role="tooltip">' + '<
|
3377
|
+
template: '<div class="popover" role="tooltip">' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
|
3395
3378
|
});
|
3396
3379
|
|
3397
3380
|
var DefaultType = $.extend({}, Tooltip.DefaultType, {
|
@@ -3400,13 +3383,12 @@ var Popover = (function ($) {
|
|
3400
3383
|
|
3401
3384
|
var ClassName = {
|
3402
3385
|
FADE: 'fade',
|
3403
|
-
|
3386
|
+
SHOW: 'show'
|
3404
3387
|
};
|
3405
3388
|
|
3406
3389
|
var Selector = {
|
3407
3390
|
TITLE: '.popover-title',
|
3408
|
-
CONTENT: '.popover-content'
|
3409
|
-
ARROW: '.popover-arrow'
|
3391
|
+
CONTENT: '.popover-content'
|
3410
3392
|
};
|
3411
3393
|
|
3412
3394
|
var Event = {
|
@@ -3428,85 +3410,72 @@ var Popover = (function ($) {
|
|
3428
3410
|
* ------------------------------------------------------------------------
|
3429
3411
|
*/
|
3430
3412
|
|
3431
|
-
var Popover =
|
3413
|
+
var Popover = function (_Tooltip) {
|
3432
3414
|
_inherits(Popover, _Tooltip);
|
3433
3415
|
|
3434
3416
|
function Popover() {
|
3435
3417
|
_classCallCheck(this, Popover);
|
3436
3418
|
|
3437
|
-
|
3419
|
+
return _possibleConstructorReturn(this, _Tooltip.apply(this, arguments));
|
3438
3420
|
}
|
3439
3421
|
|
3440
|
-
|
3441
|
-
* ------------------------------------------------------------------------
|
3442
|
-
* jQuery
|
3443
|
-
* ------------------------------------------------------------------------
|
3444
|
-
*/
|
3422
|
+
// overrides
|
3445
3423
|
|
3446
|
-
|
3447
|
-
|
3424
|
+
Popover.prototype.isWithContent = function isWithContent() {
|
3425
|
+
return this.getTitle() || this._getContent();
|
3426
|
+
};
|
3448
3427
|
|
3449
|
-
|
3428
|
+
Popover.prototype.getTipElement = function getTipElement() {
|
3429
|
+
return this.tip = this.tip || $(this.config.template)[0];
|
3430
|
+
};
|
3450
3431
|
|
3451
|
-
|
3452
|
-
|
3453
|
-
}
|
3454
|
-
}, {
|
3455
|
-
key: 'getTipElement',
|
3456
|
-
value: function getTipElement() {
|
3457
|
-
return this.tip = this.tip || $(this.config.template)[0];
|
3458
|
-
}
|
3459
|
-
}, {
|
3460
|
-
key: 'setContent',
|
3461
|
-
value: function setContent() {
|
3462
|
-
var $tip = $(this.getTipElement());
|
3432
|
+
Popover.prototype.setContent = function setContent() {
|
3433
|
+
var $tip = $(this.getTipElement());
|
3463
3434
|
|
3464
|
-
|
3465
|
-
|
3466
|
-
|
3435
|
+
// we use append for html objects to maintain js events
|
3436
|
+
this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
|
3437
|
+
this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
|
3467
3438
|
|
3468
|
-
|
3439
|
+
$tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW);
|
3469
3440
|
|
3470
|
-
|
3471
|
-
|
3441
|
+
this.cleanupTether();
|
3442
|
+
};
|
3472
3443
|
|
3473
|
-
|
3444
|
+
// private
|
3474
3445
|
|
3475
|
-
|
3476
|
-
|
3477
|
-
|
3478
|
-
return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
|
3479
|
-
}
|
3446
|
+
Popover.prototype._getContent = function _getContent() {
|
3447
|
+
return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
|
3448
|
+
};
|
3480
3449
|
|
3481
|
-
|
3450
|
+
// static
|
3482
3451
|
|
3483
|
-
|
3484
|
-
|
3485
|
-
|
3486
|
-
|
3487
|
-
var data = $(this).data(DATA_KEY);
|
3488
|
-
var _config = typeof config === 'object' ? config : null;
|
3452
|
+
Popover._jQueryInterface = function _jQueryInterface(config) {
|
3453
|
+
return this.each(function () {
|
3454
|
+
var data = $(this).data(DATA_KEY);
|
3455
|
+
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
|
3489
3456
|
|
3490
|
-
|
3491
|
-
|
3492
|
-
|
3457
|
+
if (!data && /destroy|hide/.test(config)) {
|
3458
|
+
return;
|
3459
|
+
}
|
3493
3460
|
|
3494
|
-
|
3495
|
-
|
3496
|
-
|
3497
|
-
|
3461
|
+
if (!data) {
|
3462
|
+
data = new Popover(this, _config);
|
3463
|
+
$(this).data(DATA_KEY, data);
|
3464
|
+
}
|
3498
3465
|
|
3499
|
-
|
3500
|
-
|
3501
|
-
|
3502
|
-
}
|
3503
|
-
data[config]();
|
3466
|
+
if (typeof config === 'string') {
|
3467
|
+
if (data[config] === undefined) {
|
3468
|
+
throw new Error('No method named "' + config + '"');
|
3504
3469
|
}
|
3505
|
-
|
3506
|
-
|
3507
|
-
|
3470
|
+
data[config]();
|
3471
|
+
}
|
3472
|
+
});
|
3473
|
+
};
|
3474
|
+
|
3475
|
+
_createClass(Popover, null, [{
|
3508
3476
|
key: 'VERSION',
|
3509
3477
|
|
3478
|
+
|
3510
3479
|
// getters
|
3511
3480
|
|
3512
3481
|
get: function get() {
|
@@ -3545,7 +3514,13 @@ var Popover = (function ($) {
|
|
3545
3514
|
}]);
|
3546
3515
|
|
3547
3516
|
return Popover;
|
3548
|
-
}
|
3517
|
+
}(Tooltip);
|
3518
|
+
|
3519
|
+
/**
|
3520
|
+
* ------------------------------------------------------------------------
|
3521
|
+
* jQuery
|
3522
|
+
* ------------------------------------------------------------------------
|
3523
|
+
*/
|
3549
3524
|
|
3550
3525
|
$.fn[NAME] = Popover._jQueryInterface;
|
3551
3526
|
$.fn[NAME].Constructor = Popover;
|
@@ -3555,6 +3530,6 @@ var Popover = (function ($) {
|
|
3555
3530
|
};
|
3556
3531
|
|
3557
3532
|
return Popover;
|
3558
|
-
})(jQuery);
|
3559
|
-
|
3560
3533
|
}(jQuery);
|
3534
|
+
|
3535
|
+
}();
|