</h2>
<div>{{{framework.description}}}</div>
<h3>{{#str}}competencies, core_competency{{/str}}</h3>
- <div class="row-fluid">
+ <div class="row-fluid row">
<div class="span6 col-lg-6">
<p>
<form data-region="filtercompetencies" data-frameworkid="{{framework.id}}" class="form-inline">
</div>
<div class="span6 card col-lg-6">
- <div class="card-block">
+ <div class="card-block card-body">
<div class="card-title">
<h4 data-region="selected-competency">{{#str}}selectedcompetency, tool_lp{{/str}}</h4>
<span data-region="competencyactionsmenu" class="pull-xs-right">
*/
public function definition_after_data() {
$buttonarray = array();
- $buttonarray[] = $this->_form->createElement(
- 'submit',
- 'submitbutton',
- get_string($this->uistage->get_ui()->get_name().'stage'.$this->uistage->get_stage().'action', 'backup'),
- array('class' => 'proceedbutton')
- );
if (!$this->uistage->is_first_stage()) {
$buttonarray[] = $this->_form->createElement('submit', 'previous', get_string('previousstage', 'backup'));
} else if ($this->uistage instanceof backup_ui_stage) {
array('class' => 'oneclickbackup'));
}
$buttonarray[] = $this->_form->createElement('cancel', 'cancel', get_string('cancel'), array('class' => 'confirmcancel'));
+ $buttonarray[] = $this->_form->createElement(
+ 'submit',
+ 'submitbutton',
+ get_string($this->uistage->get_ui()->get_name().'stage'.$this->uistage->get_stage().'action', 'backup'),
+ array('class' => 'proceedbutton')
+ );
$this->_form->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$this->_form->closeHeaderBefore('buttonar');
$count ++;
$html = html_writer::start_tag('div', array('class' => 'detail-pair'));
$html .= html_writer::tag('label', $label, array('class' => 'detail-pair-label', 'for' => 'detail-pair-value-'.$count));
- $html .= html_writer::tag('div', $value, array('class' => 'detail-pair-value', 'name' => 'detail-pair-value-'.$count));
+ $html .= html_writer::tag('div', $value, array('class' => 'detail-pair-value pl-2', 'name' => 'detail-pair-value-'.$count));
$html .= html_writer::end_tag('div');
return $html;
}
$url = $component->get_url();
$output = html_writer::start_tag('div', array('class' => 'restore-course-search form-inline m-b-1'));
- $output .= html_writer::start_tag('div', array('class' => 'rcs-results'));
+ $output .= html_writer::start_tag('div', array('class' => 'rcs-results w-100'));
$table = new html_table();
$table->head = array('', get_string('name'), get_string('description'));
</p>
</div>
</div>
- <div class="hidden-md-down col-lg-5 col-xl-4 text-truncate">
+ <div class="hidden-md-down d-none d-md-block col-lg-5 col-xl-4 text-truncate">
{{#action.actionable}}
<a href="{{{action.url}}}">{{action.name}}</a>
{{#action.itemcount}}
}
}}
<div class="course-info-container" id="course-info-container-{{id}}">
- <div class="hidden-sm-up hidden-tablet hidden-phone">
+ <div class="d-sm-none d-lg-block">
{{> block_myoverview/progress-chart}}
<h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
</div>
- <div class="hidden-sm-down hidden-tablet hidden-desktop">
- {{> block_myoverview/progress-chart}}
- <h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
- </div>
- <div class="hidden-xs-down hidden-md-up visible-tablet">
+ <div class="d-none d-sm-block d-lg-none visible-tablet">
<div class="media">
- <div class="media-left">
+ <div class="media-left pr-3">
<div class="media-object">
{{> block_myoverview/progress-chart}}
</div>
}
}}
<div class="col-lg-6">
- <div class="card m-b-1 courses-view-course-item">
- <div class="card-block course-info-container" id="course-info-container-{{id}}">
- <div class="hidden-sm-up hidden-phone">
- {{> block_myoverview/progress-chart}}
- <h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
- </div>
- <div class="hidden-xs-down visible-phone">
- <div class="media">
- <div class="media-left">
- <div class="media-object">
- {{> block_myoverview/progress-chart}}
- </div>
- </div>
- <div class="media-body">
- <h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
- </div>
+ <div class="card mb-3 courses-view-course-item">
+ <div class="card-body course-info-container" id="course-info-container-{{id}}">
+
+ <div class="media">
+ <div class="mr-2">
+ {{> block_myoverview/progress-chart}}
+ </div>
+ <div class="media-body">
+ <h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
</div>
</div>
+
<p class="text-muted">
{{#shortentext}} 140, {{summary}}{{/shortentext}}
</p>
</div>
</div>
-</div>
+</div>
\ No newline at end of file
}}
<div id="courses-view-{{uniqid}}" data-region="courses-view">
{{#hascourses}}
- <div class="text-xs-center text-center">
- <div class="btn-group m-y-2" role="group" data-toggle="btns">
- <a class="btn btn-default active" href="#myoverview_courses_view_in_progress" data-toggle="tab">
- {{#str}} inprogress, block_myoverview {{/str}}
- </a>
- <a class="btn btn-default" href="#myoverview_courses_view_future" data-toggle="tab">
- {{#str}} future, block_myoverview {{/str}}
- </a>
- <a class="btn btn-default" href="#myoverview_courses_view_past" data-toggle="tab">
- {{#str}} past, block_myoverview {{/str}}
- </a>
- </div>
+ <div class="d-flex justify-content-center">
+ <ul class="nav nav-pills my-5">
+ <li class="nav-item">
+ <a class="nav-link active" href="#myoverview_courses_view_in_progress" data-toggle="tab">
+ {{#str}} inprogress, block_myoverview {{/str}}
+ </a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="#myoverview_courses_view_future" data-toggle="tab">
+ {{#str}} future, block_myoverview {{/str}}
+ </a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="#myoverview_courses_view_past" data-toggle="tab">
+ {{#str}} past, block_myoverview {{/str}}
+ </a>
+ </li>
+ </ul>
</div>
<div class="tab-content">
- <div class="tab-pane active fade in" id="myoverview_courses_view_in_progress">
+ <div class="tab-pane active fade show" id="myoverview_courses_view_in_progress">
{{#inprogress}}
{{< block_myoverview/courses-view-by-status }}
{{$id}}courses-view-in-progress{{/id}}
{{/ block_myoverview/courses-view-by-status }}
{{/inprogress}}
{{^inprogress}}
- <div class="text-xs-center text-center m-t-3">
+ <div class="justify-content-center text-center mt-5">
<img class="empty-placeholder-image-lg"
src="{{urls.nocourses}}"
alt="{{#str}} nocoursesinprogress, block_myoverview {{/str}}"
role="presentation">
- <p class="text-muted m-t-1">{{#str}} nocoursesinprogress, block_myoverview {{/str}}</p>
+ <p class="text-muted mt-3">{{#str}} nocoursesinprogress, block_myoverview {{/str}}</p>
</div>
{{/inprogress}}
</div>
{{/ block_myoverview/courses-view-by-status }}
{{/future}}
{{^future}}
- <div class="text-xs-center text-center m-t-3">
+ <div class="justify-content-center text-center mt-5">
<img class="empty-placeholder-image-lg"
src="{{urls.nocourses}}"
alt="{{#str}} nocoursesfuture, block_myoverview {{/str}}"
role="presentation">
- <p class="text-muted m-t-1">{{#str}} nocoursesfuture, block_myoverview {{/str}}</p>
+ <p class="text-muted mt-3">{{#str}} nocoursesfuture, block_myoverview {{/str}}</p>
</div>
{{/future}}
</div>
{{/ block_myoverview/courses-view-by-status }}
{{/past}}
{{^past}}
- <div class="text-xs-center text-center m-t-3">
+ <div class="justify-content-center text-center mt-5">
<img class="empty-placeholder-image-lg"
src="{{urls.nocourses}}"
alt="{{#str}} nocoursespast, block_myoverview {{/str}}"
role="presentation">
- <p class="text-muted m-t-1">{{#str}} nocoursespast, block_myoverview {{/str}}</p>
+ <p class="text-muted mt-3">{{#str}} nocoursespast, block_myoverview {{/str}}</p>
</div>
{{/past}}
</div>
</div>
{{/hascourses}}
{{^hascourses}}
- <div class="text-xs-center text-center m-t-3">
+ <div class="justify-content-center text-center mt-5">
<img class="empty-placeholder-image-lg"
src="{{urls.nocourses}}"
alt="{{#str}} nocourses, block_myoverview {{/str}}"
role="presentation">
- <p class="text-muted m-t-1">{{#str}} nocourses, block_myoverview {{/str}}</p>
+ <p class="text-muted mt-3">{{#str}} nocourses, block_myoverview {{/str}}</p>
</div>
{{/hascourses}}
-</div>
-{{#js}}
-require(['jquery', 'core/custom_interaction_events'], function($, customEvents) {
- var root = $('#courses-view-{{uniqid}}');
- customEvents.define(root, [customEvents.events.activate]);
- root.on(customEvents.events.activate, '[data-toggle="btns"] > .btn', function() {
- root.find('.btn.active').removeClass('active');
- });
-});
-{{/js}}
+</div>
\ No newline at end of file
<div class="col-lg-5 text-xs-right text-lg-left text-truncate">
{{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}}
</div>
- <div class="hidden-md-down col-lg-7 text-truncate">
+ <div class="hidden-md-down d-none d-md-block col-lg-7 text-truncate">
{{#action.actionable}}
<a href="{{{action.url}}}">{{action.name}}</a>
{{#action.itemcount}}
{}
}}
<div id="timeline-view-{{uniqid}}" data-region="timeline-view">
- <div class="row text-xs-center">
- <div class="btn-group m-t-2" role="group" data-toggle="btns">
- <a class="btn btn-default active" href="#myoverview_timeline_dates" data-toggle="tab">
+ <div class="d-flex justify-content-center">
+ <ul class="nav nav-pills my-5">
+ <li class="nav-item">
+ <a class="nav-link active" href="#myoverview_timeline_dates" data-toggle="tab">
{{#str}} sortbydates, block_myoverview {{/str}}
</a>
- <a class="btn btn-default" href="#myoverview_timeline_courses" data-toggle="tab">
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="#myoverview_timeline_courses" data-toggle="tab">
{{#str}} sortbycourses, block_myoverview {{/str}}
</a>
- </div>
+ </li>
+ </ul>
</div>
<div class="tab-content">
- <div class="tab-pane active fade in" id="myoverview_timeline_dates">
+ <div class="tab-pane active fade show" id="myoverview_timeline_dates">
{{> block_myoverview/timeline-view-dates }}
</div>
<div class="tab-pane fade" id="myoverview_timeline_courses">
{{> block_myoverview/timeline-view-courses }}
</div>
</div>
-</div>
-{{#js}}
-require(['jquery', 'core/custom_interaction_events'], function($, customEvents) {
- var root = $('#timeline-view-{{uniqid}}');
- customEvents.define(root, [customEvents.events.activate]);
- root.on(customEvents.events.activate, '[data-toggle="btns"] > .btn', function() {
- root.find('.btn.active').removeClass('active');
- });
-});
-{{/js}}
+</div>
\ No newline at end of file
}
$this->execute('behat_general::i_click_on_in_the',
- array("a[role='menuitem']", "css_element", $this->escape($blockname), "block")
+ array("a[role='button']", "css_element", $this->escape($blockname), "block")
);
}
{{> core_calendar/header }}
{{> core_calendar/month_navigation }}
{{> core/overlay_loading}}
- <table id="month-detailed-{{uniqid}}" class="calendarmonth calendartable card-deck m-b-0">
+ <table id="month-detailed-{{uniqid}}" class="calendarmonth calendartable m-b-0">
<thead>
<tr>
{{# daynames }}
data-drop-zone="month-view-day"
data-region="day"
data-new-event-timestamp="{{neweventtimestamp}}">
- <div class="hidden-sm-down hidden-phone text-xs-center">
+ <div class="d-none d-md-block hidden-phone text-xs-center">
{{#hasevents}}
<a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
{{/hasevents}}
</div>
{{/hasevents}}
</div>
- <div class="hidden-md-up hidden-desktop hidden-tablet">
+ <div class="d-md-none hidden-desktop hidden-tablet">
{{#hasevents}}
<a data-action="view-day-link" href="{{viewdaylink}}" class="day" title="{{viewdaylinktitle}}">{{mday}}</a>
{{/hasevents}}
$listing = coursecat::get(0)->get_children();
$attributes = array(
- 'class' => 'ml',
+ 'class' => 'ml-1',
'role' => 'tree',
'aria-labelledby' => 'category-listing-title'
);
$html .= html_writer::end_div();
if ($isexpanded) {
$html .= html_writer::start_tag('ul',
- array('class' => 'ml', 'role' => 'group', 'id' => 'subcategoryof'.$category->id));
+ array('class' => 'ml-1', 'role' => 'group', 'id' => 'subcategoryof'.$category->id));
$catatlevel = \core_course\management\helper::get_expanded_categories($category->path);
$catatlevel[] = array_shift($selectedcategories);
$catatlevel = array_unique($catatlevel);
array('id' => 'course-listing-title', 'tabindex' => '0'));
$html .= $this->course_listing_actions($category, $course, $perpage);
$html .= $this->listing_pagination($category, $page, $perpage);
- $html .= html_writer::start_tag('ul', array('class' => 'ml', 'role' => 'group'));
+ $html .= html_writer::start_tag('ul', array('class' => 'ml-1', 'role' => 'group'));
foreach ($category->get_courses($options) as $listitem) {
$html .= $this->course_listitem($category, $listitem, $courseid);
}
));
$html .= html_writer::tag('h3', get_string('courses'));
$html .= $this->search_pagination($totalcourses, $page, $perpage);
- $html .= html_writer::start_tag('ul', array('class' => 'ml'));
+ $html .= html_writer::start_tag('ul', array('class' => 'ml-1'));
foreach ($courses as $listitem) {
$i++;
if ($i == $totalcourses) {
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And I toggle visibility of category "CAT1" in management listing
# Redirect.
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And I toggle visibility of category "CAT1" in management listing
And a new page should not have loaded since I started watching
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should not see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And I toggle visibility of category "CAT2" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be dimmed "CAT2"
And I toggle visibility of category "CAT2" in management listing
# Redirect.
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should not see "Cat 2" in the "#category-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And I click to expand category "CAT1" in the management interface
And a new page should not have loaded since I started watching
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 4" in the "#category-listing ul.ml" "css_element"
- And I should see "Course 1" in the "#course-listing ul.ml" "css_element"
- And I should see "Course 2" in the "#course-listing ul.ml" "css_element"
- And I should see "Course 3" in the "#course-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Cat 2" in the "#category-listing ul" "css_element"
+ And I should see "Cat 3" in the "#category-listing ul" "css_element"
+ And I should see "Cat 4" in the "#category-listing ul" "css_element"
+ And I should see "Course 1" in the "#course-listing ul" "css_element"
+ And I should see "Course 2" in the "#course-listing ul" "css_element"
+ And I should see "Course 3" in the "#course-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be visible "CAT3"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 4" in the "#category-listing ul.ml" "css_element"
- And I should see "Course 1" in the "#course-listing ul.ml" "css_element"
- And I should see "Course 2" in the "#course-listing ul.ml" "css_element"
- And I should see "Course 3" in the "#course-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Cat 2" in the "#category-listing ul" "css_element"
+ And I should see "Cat 3" in the "#category-listing ul" "css_element"
+ And I should see "Cat 4" in the "#category-listing ul" "css_element"
+ And I should see "Course 1" in the "#course-listing ul" "css_element"
+ And I should see "Course 2" in the "#course-listing ul" "css_element"
+ And I should see "Course 3" in the "#course-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And category in management listing should be visible "CAT2"
And category in management listing should be visible "CAT3"
And course in management listing should be visible "C3"
And I toggle visibility of course "C2" in management listing
And a new page should not have loaded since I started watching
- And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 3" in the "#category-listing ul" "css_element"
And course in management listing should be visible "C1"
And course in management listing should be dimmed "C2"
And course in management listing should be visible "C3"
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Cat 2" in the "#category-listing ul" "css_element"
+ And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I click on "delete" action for "Cat 2" in management category listing
# Redirect
And I should see "Delete category: Cat 2"
And I press "Cancel"
# Redirect
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Cat 2" in the "#category-listing ul" "css_element"
+ And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I click on "delete" action for "Cat 2" in management category listing
# Redirect
And I should see "Delete category: Cat 2"
And I press "Continue"
# Redirect
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should not see "Cat 2" in the "#category-listing ul" "css_element"
+ And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I click on "delete" action for "Cat 3" in management category listing
# Redirect
And I should see "Delete category: Cat 3"
And I press "Continue"
# Redirect
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element"
- And I should not see "Cat 3" in the "#category-listing ul.ml" "css_element"
- And I should see "Course 1" in the "#course-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should not see "Cat 2" in the "#category-listing ul" "css_element"
+ And I should not see "Cat 3" in the "#category-listing ul" "css_element"
+ And I should see "Course 1" in the "#course-listing ul" "css_element"
Scenario: Test I can assign roles for a category through the management interface.
Given the following "categories" exist:
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Cat 2" in the "#category-listing ul" "css_element"
+ And I should see "Cat 3" in the "#category-listing ul" "css_element"
And I select category "Cat 2" in the management interface
And I select category "Cat 3" in the management interface
And I set the field "menumovecategoriesto" to "Cat 1"
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
- And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Cat 2" in the "#category-listing ul" "css_element"
+ And I should see "Cat 3" in the "#category-listing ul" "css_element"
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
And I click on category "Cat 3" in the management interface
#Redirect
And I should see the "Course categories and courses" management page
- And I should see "Course 1" in the "#course-listing ul.ml" "css_element"
- And I should see "Course 2" in the "#course-listing ul.ml" "css_element"
+ And I should see "Course 1" in the "#course-listing ul" "css_element"
+ And I should see "Course 2" in the "#course-listing ul" "css_element"
And the "movecategoriesto" "select" should be disabled
And the "resortcategoriesby" "select" should be disabled
And the "resortcoursesby" "select" should be disabled
And I log in as "admin"
And I go to the courses management page
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click on "Cat 1" "link"
# Redirect.
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click on "Cat 1-1" "link"
# Redirect.
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click on "Cat 2" "link"
# Redirect.
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
# This is similar to the above scenario except here we are going to use AJAX
# to load the categories.
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT1" in the management interface
And a new page should not have loaded since I started watching
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT3" in the management interface
And a new page should not have loaded since I started watching
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT2" in the management interface
And a new page should not have loaded since I started watching
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT7" in the management interface
And a new page should not have loaded since I started watching
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT1" in the management interface
And a new page should not have loaded since I started watching
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT1" in the management interface
And a new page should not have loaded since I started watching
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
@javascript
Scenario Outline: Top level categories are displayed correctly when resorted
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT2" in the management interface
And a new page should not have loaded since I started watching
And I click to expand category "CAT7" in the management interface
And a new page should not have loaded since I started watching
And I click to expand category "CAT9" in the management interface
And a new page should not have loaded since I started watching
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-2-1" in the "#course-category-listings ul" "css_element"
And I click on "Cat 1" category in the management category listing
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-2-1" in the "#course-category-listings ul" "css_element"
And I click on "resortbyidnumber" action for "Cat 1" in management category listing
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-2" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat 1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 1-2" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-2" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat 2-1-2-1" in the "#course-category-listings ul" "css_element"
@javascript
Scenario: Test category expansion after deletion
And I go to the courses management page
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
- And I should see "Cat A (1)" in the "#course-category-listings ul.ml" "css_element"
- And I should see "Cat B (2)" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat C (1-1)" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat D (2-1)" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat E (2-1-1)" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat A (1)" in the "#course-category-listings ul" "css_element"
+ And I should see "Cat B (2)" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat C (1-1)" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat D (2-1)" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat E (2-1-1)" in the "#course-category-listings ul" "css_element"
And I click to expand category "CAT1" in the management interface
- And I should see "Cat C (1-1)" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat C (1-1)" in the "#course-category-listings ul" "css_element"
And a new page should not have loaded since I started watching
And I click to expand category "CAT2" in the management interface
- And I should see "Cat D (2-1)" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat D (2-1)" in the "#course-category-listings ul" "css_element"
And a new page should not have loaded since I started watching
And I click to expand category "CAT4" in the management interface
- And I should see "Cat E (2-1-1)" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat E (2-1-1)" in the "#course-category-listings ul" "css_element"
And a new page should not have loaded since I started watching
And I click on "delete" action for "Cat B (2)" in management category listing
And a new page should have loaded since I started watching
And I press "Continue"
And a new page should have loaded since I started watching
And I should see the "Course categories and courses" management page
- And I should see "Cat A (1)" in the "#course-category-listings ul.ml" "css_element"
- And I should not see "Cat B (2)" in the "#course-category-listings ul.ml" "css_element"
+ And I should see "Cat A (1)" in the "#course-category-listings ul" "css_element"
+ And I should not see "Cat B (2)" in the "#course-category-listings ul" "css_element"
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Course 1" in the "#course-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Course 1" in the "#course-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And course in management listing should be visible "C1"
And I toggle visibility of course "C1" in management listing
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
And I should see the "Course categories and courses" management page
- And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
- And I should see "Course 1" in the "#course-listing ul.ml" "css_element"
+ And I should see "Cat 1" in the "#category-listing ul" "css_element"
+ And I should see "Course 1" in the "#course-listing ul" "css_element"
And category in management listing should be visible "CAT1"
And course in management listing should be visible "C1"
And I toggle visibility of course "C1" in management listing
And I click on "Courses" "link" in the ".view-mode-selector" "css_element"
And a new page should have loaded since I started watching
And I start watching to see if a new page loads
- And I should see "Course 1" in the "#course-listing ul.ml" "css_element"
+ And I should see "Course 1" in the "#course-listing ul" "css_element"
And I toggle visibility of course "C1" in management listing
And a new page should not have loaded since I started watching
And course in management listing should be dimmed "C1"
Scenario: Search courses finds correct results
Given I log in as "admin"
And I go to the courses management page
- When I set the field "Search courses" to "Biology"
+ When I set the field "coursesearchbox" to "Biology"
And I press "Go"
Then I should see "Biology Y1"
And I should see "Biology Y2"
Scenario: Search courses and move results in bulk
Given I log in as "admin"
And I go to the courses management page
- And I set the field "Search courses" to "Biology"
+ And I set the field "coursesearchbox" to "Biology"
And I press "Go"
When I select course "Biology Y1" in the management interface
And I select course "Biology Y2" in the management interface
And I follow "Miscellaneous"
And I follow "Sample course"
And I press "Continue"
- Then I should see "Courses" in the ".breadcrumb-nav" "css_element"
- And I click on "Courses" "link" in the ".breadcrumb-nav" "css_element"
+ Then I should see "Courses" in the ".breadcrumb" "css_element"
+ And I click on "Courses" "link" in the ".breadcrumb" "css_element"
And I follow "Sample category"
And I am on "Course 1" course homepage
And I press "Continue"
- And I should see "Sample category" in the ".breadcrumb-nav" "css_element"
+ And I should see "Sample category" in the ".breadcrumb" "css_element"
@javascript
Scenario: A user can return to the previous page from enrolment page by clicking navigation links
And I expand "Sample category" node
And I follow "Course 1"
And I press "Continue"
- Then I should see "Edit profile" in the ".breadcrumb-nav" "css_element"
+ Then I should see "Edit profile" in the ".breadcrumb" "css_element"
Scenario: User can return to the choice activity from enrolment page
Given the following "roles" exist:
And I should see "Sorry, only enrolled users are allowed to make choices."
And I press "Enrol me in this course"
And I press "Continue"
- Then I should see "Test choice" in the ".breadcrumb-nav" "css_element"
+ Then I should see "Test choice" in the ".breadcrumb" "css_element"
XPATH
, 'block' => <<<XPATH
.//*[@data-block][contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' ')) or
- descendant::*[self::h2|self::h3][normalize-space(.) = %locator%] or
+ descendant::*[self::h2|self::h3|self::h4|self::h5][normalize-space(.) = %locator%] or
@aria-label = %locator%]
XPATH
, 'dialogue' => <<<XPATH
.//div[
contains(concat(' ', normalize-space(@class), ' '), ' modal-content ')
and
- normalize-space(descendant::h4[contains(concat(' ', normalize-space(@class), ' '), ' modal-title ')]) = %locator%
+ normalize-space(descendant::*[self::h4 or self::h5][contains(concat(' ', normalize-space(@class), ' '), ' modal-title ')]) = %locator%
]
|
.//div[
<div class="filemanager-loading mdl-align" id='filepicker-loading-{$client_id}'>
$icon_progress
</div>
-<div id="filepicker-wrapper-{$client_id}" class="mdl-left" style="display:none">
+<div id="filepicker-wrapper-{$client_id}" class="mdl-left w-100" style="display:none">
<div>
<input type="button" class="btn btn-secondary fp-btn-choose" id="filepicker-button-{$client_id}" value="{$straddfile}"{$buttonname}/>
<span> $maxsize </span>
}
$returnstr .= html_writer::span(
- html_writer::span($usertextcontents, 'usertext') .
+ html_writer::span($usertextcontents, 'usertext mr-1') .
html_writer::span($avatarcontents, $avatarclasses),
'userbutton'
);
And I am on "Course 1" course homepage
And I follow "TestAssignment"
When I navigate to "View all submissions" in current page administration
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should not see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I am on "Course 1" course homepage
And I follow "TestAssignment"
When I navigate to "View all submissions" in current page administration
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should not see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "All" "link" in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "All" "link" in the ".initialbar.lastinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I follow "TestAssignment"
When I navigate to "View all submissions" in current page administration
And I select "View gradebook" from the "jump" singleselect
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should not see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I follow "TestAssignment"
When I navigate to "View all submissions" in current page administration
And I select "View gradebook" from the "jump" singleselect
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should not see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "All" "link" in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "All" "link" in the ".initialbar.lastinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Participants"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should not see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I am on "Course 1" course homepage
And I follow "Participants"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should not see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "All" "link" in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "All" "link" in the ".initialbar.lastinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I log in as "teacher"
And I am on "Course 1" course homepage
And I navigate to "Activity completion" node in "Course administration > Reports"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should not see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I am on "Course 1" course homepage
And I navigate to "Activity completion" node in "Course administration > Reports"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should not see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "All" "link" in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "All" "link" in the ".initialbar.lastinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
- And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
- And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
- And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
+ And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
+ And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
+ And ".page-item.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
| Description | Description of tag 1 |
| Related tags | Dog, Turtle,Fish |
And I press "Update"
- Then "Cat" "text" should exist in the ".breadcrumb-nav" "css_element"
+ Then "Cat" "text" should exist in the ".breadcrumb" "css_element"
And "Description of tag 1" "text" should exist in the ".tag-description" "css_element"
And I should see "Related tags:" in the ".tag_list" "css_element"
And I should see "Dog" in the ".tag_list" "css_element"
| Related tags | Dog, Turtle,Fish |
| Standard | 0 |
And I press "Update"
- Then "Kitten" "text" should exist in the ".breadcrumb-nav" "css_element"
+ Then "Kitten" "text" should exist in the ".breadcrumb" "css_element"
And "Description of tag 1" "text" should exist in the ".tag-description" "css_element"
And I should see "Related tags:" in the ".tag_list" "css_element"
And I should see "Dog" in the ".tag_list" "css_element"
And I follow "Edit this tag"
And I click on "× Dog" "text"
And I press "Update"
- Then "Kitten" "text" should exist in the ".breadcrumb-nav" "css_element"
+ Then "Kitten" "text" should exist in the ".breadcrumb" "css_element"
And "Description of tag 1" "text" should exist in the ".tag-description" "css_element"
And I should see "Related tags:" in the ".tag_list" "css_element"
And I should see "Turtle" in the ".tag_list" "css_element"
And I set the following fields to these values:
| Tag name | Kitten |
And I press "Update"
- Then "Kitten" "text" should exist in the ".breadcrumb-nav" "css_element"
+ Then "Kitten" "text" should exist in the ".breadcrumb" "css_element"
And I follow "Edit this tag"
And I set the following fields to these values:
| Tag name | KITTEN |
And I press "Update"
- And "KITTEN" "text" should exist in the ".breadcrumb-nav" "css_element"
+ And "KITTEN" "text" should exist in the ".breadcrumb" "css_element"
And I log out
@javascript
| Related tags | Dog, Turtle,Fish |
| Standard | 0 |
And I press "Update"
- Then "Default collection" "link" should exist in the ".breadcrumb-nav" "css_element"
+ Then "Default collection" "link" should exist in the ".breadcrumb" "css_element"
And I follow "Kitten"
And "Description of tag 1" "text" should exist in the ".tag-description" "css_element"
And I should see "Related tags:" in the ".tag_list" "css_element"
And I set the following fields to these values:
| Tag name | Kitten |
And I press "Update"
- Then "Default collection" "text" should exist in the ".breadcrumb-nav" "css_element"
+ Then "Default collection" "text" should exist in the ".breadcrumb" "css_element"
And I click on "Edit this tag" "link" in the "Kitten" "table_row"
And I set the following fields to these values:
| Tag name | KITTEN |
And I press "Update"
- And "Default collection" "text" should exist in the ".breadcrumb-nav" "css_element"
+ And "Default collection" "text" should exist in the ".breadcrumb" "css_element"
And I should see "KITTEN"
And I should not see "Kitten"
And I log out
-define(['exports', './util'], function (exports, _util) {
- 'use strict';
+define(["exports", "jquery", "./util"], function (exports, _jquery, _util) {
+ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+ var _jquery2 = _interopRequireDefault(_jquery);
+
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) {
}
}
- 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);
- }
+ 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;
- };
- }();
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-alpha.4): alert.js
+ * Bootstrap (v4.0.0): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
-
var Alert = function ($) {
-
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
-
var NAME = 'alert';
- var VERSION = '4.0.0-alpha.4';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.alert';
- var EVENT_KEY = '.' + DATA_KEY;
+ var EVENT_KEY = ".".concat(DATA_KEY);
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 150;
-
var Selector = {
DISMISS: '[data-dismiss="alert"]'
};
-
var Event = {
- CLOSE: 'close' + EVENT_KEY,
- CLOSED: 'closed' + EVENT_KEY,
- CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
+ CLOSE: "close".concat(EVENT_KEY),
+ CLOSED: "closed".concat(EVENT_KEY),
+ CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY)
};
-
var ClassName = {
ALERT: 'alert',
FADE: 'fade',
- IN: 'in'
- };
+ SHOW: 'show'
+ /**
+ * ------------------------------------------------------------------------
+ * Class Definition
+ * ------------------------------------------------------------------------
+ */
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
+ };
var Alert = function () {
function Alert(element) {
_classCallCheck(this, Alert);
this._element = element;
- }
+ } // Getters
- // getters
_createClass(Alert, [{
- key: 'close',
+ key: "close",
value: function close(element) {
element = element || this._element;
var rootElement = this._getRootElement(element);
+
var customEvent = this._triggerCloseEvent(rootElement);
if (customEvent.isDefaultPrevented()) {
this._removeElement(rootElement);
}
}, {
- key: 'dispose',
+ key: "dispose",
value: function dispose() {
$.removeData(this._element, DATA_KEY);
this._element = null;
}
}, {
- key: '_getRootElement',
+ key: "_getRootElement",
value: function _getRootElement(element) {
var selector = _util2.default.getSelectorFromElement(element);
+
var parent = false;
if (selector) {
}
if (!parent) {
- parent = $(element).closest('.' + ClassName.ALERT)[0];
+ parent = $(element).closest(".".concat(ClassName.ALERT))[0];
}
return parent;
}
}, {
- key: '_triggerCloseEvent',
+ key: "_triggerCloseEvent",
value: function _triggerCloseEvent(element) {
var closeEvent = $.Event(Event.CLOSE);
-
$(element).trigger(closeEvent);
return closeEvent;
}
}, {
- key: '_removeElement',
+ key: "_removeElement",
value: function _removeElement(element) {
- $(element).removeClass(ClassName.IN);
+ var _this = this;
+
+ $(element).removeClass(ClassName.SHOW);
if (!_util2.default.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
this._destroyElement(element);
+
return;
}
- $(element).one(_util2.default.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION);
+ $(element).one(_util2.default.TRANSITION_END, function (event) {
+ return _this._destroyElement(element, event);
+ }).emulateTransitionEnd(TRANSITION_DURATION);
}
}, {
- key: '_destroyElement',
+ key: "_destroyElement",
value: function _destroyElement(element) {
$(element).detach().trigger(Event.CLOSED).remove();
}
}], [{
- key: '_jQueryInterface',
+ key: "_jQueryInterface",
value: function _jQueryInterface(config) {
return this.each(function () {
var $element = $(this);
});
}
}, {
- key: '_handleDismiss',
+ key: "_handleDismiss",
value: function _handleDismiss(alertInstance) {
return function (event) {
if (event) {
};
}
}, {
- key: 'VERSION',
+ key: "VERSION",
get: function get() {
return VERSION;
}
* Data Api implementation
* ------------------------------------------------------------------------
*/
-
$(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
-
/**
* ------------------------------------------------------------------------
* jQuery
$.fn[NAME] = Alert._jQueryInterface;
$.fn[NAME].Constructor = Alert;
+
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Alert._jQueryInterface;
};
return Alert;
- }(jQuery);
+ }(_jquery2.default);
exports.default = Alert;
});
\ No newline at end of file
-define(['exports'], function (exports) {
- 'use strict';
+define(["exports", "jquery"], function (exports, _jquery) {
+ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+ var _jquery2 = _interopRequireDefault(_jquery);
+
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : {
+ default: obj
+ };
+ }
+
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
- 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);
- }
+ 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;
- };
- }();
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-alpha.4): button.js
+ * Bootstrap (v4.0.0): button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
-
var Button = function ($) {
-
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
-
var NAME = 'button';
- var VERSION = '4.0.0-alpha.4';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.button';
- var EVENT_KEY = '.' + DATA_KEY;
+ var EVENT_KEY = ".".concat(DATA_KEY);
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
-
var ClassName = {
ACTIVE: 'active',
BUTTON: 'btn',
FOCUS: 'focus'
};
-
var Selector = {
DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
DATA_TOGGLE: '[data-toggle="buttons"]',
ACTIVE: '.active',
BUTTON: '.btn'
};
-
var Event = {
- CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
- FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY)
- };
+ CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY),
+ FOCUS_BLUR_DATA_API: "focus".concat(EVENT_KEY).concat(DATA_API_KEY, " ") + "blur".concat(EVENT_KEY).concat(DATA_API_KEY)
+ /**
+ * ------------------------------------------------------------------------
+ * Class Definition
+ * ------------------------------------------------------------------------
+ */
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
+ };
var Button = function () {
function Button(element) {
_classCallCheck(this, Button);
this._element = element;
- }
+ } // Getters
- // getters
_createClass(Button, [{
- key: 'toggle',
+ key: "toggle",
value: function toggle() {
var triggerChangeEvent = true;
+ var addAriaPressed = true;
var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
if (rootElement) {
}
if (triggerChangeEvent) {
+ if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
+ return;
+ }
+
input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
- $(this._element).trigger('change');
+ $(input).trigger('change');
}
input.focus();
+ addAriaPressed = false;
}
- } else {
+ }
+
+ if (addAriaPressed) {
this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
}
}
}
}, {
- key: 'dispose',
+ key: "dispose",
value: function dispose() {
$.removeData(this._element, DATA_KEY);
this._element = null;
}
}], [{
- key: '_jQueryInterface',
+ key: "_jQueryInterface",
value: function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
});
}
}, {
- key: 'VERSION',
+ key: "VERSION",
get: function get() {
return VERSION;
}
* Data Api implementation
* ------------------------------------------------------------------------
*/
-
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
event.preventDefault();
-
var button = event.target;
if (!$(button).hasClass(ClassName.BUTTON)) {
var button = $(event.target).closest(Selector.BUTTON)[0];
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
});
-
/**
* ------------------------------------------------------------------------
* jQuery
$.fn[NAME] = Button._jQueryInterface;
$.fn[NAME].Constructor = Button;
+
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Button._jQueryInterface;
};
return Button;
- }(jQuery);
+ }(_jquery2.default);
exports.default = Button;
});
\ No newline at end of file
-define(['exports', './util'], function (exports, _util) {
- 'use strict';
+define(["exports", "jquery", "./util"], function (exports, _jquery, _util) {
+ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+ var _jquery2 = _interopRequireDefault(_jquery);
+
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) {
};
}
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
- };
+ function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function _typeof(obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function _typeof(obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+ }
+
+ function _extends() {
+ _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ return _extends.apply(this, arguments);
+ }
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
}
}
- 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);
- }
+ 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;
- };
- }();
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-alpha.4): carousel.js
+ * Bootstrap (v4.0.0): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
-
var Carousel = function ($) {
-
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
-
var NAME = 'carousel';
- var VERSION = '4.0.0-alpha.4';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.carousel';
- var EVENT_KEY = '.' + DATA_KEY;
+ var EVENT_KEY = ".".concat(DATA_KEY);
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 600;
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
+
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
+ var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
+
var Default = {
interval: 5000,
keyboard: true,
pause: 'hover',
wrap: true
};
-
var DefaultType = {
interval: '(number|boolean)',
keyboard: 'boolean',
pause: '(string|boolean)',
wrap: 'boolean'
};
-
var Direction = {
NEXT: 'next',
- PREVIOUS: 'prev'
+ PREV: 'prev',
+ LEFT: 'left',
+ RIGHT: 'right'
};
-
var Event = {
- SLIDE: 'slide' + EVENT_KEY,
- SLID: 'slid' + EVENT_KEY,
- KEYDOWN: 'keydown' + EVENT_KEY,
- MOUSEENTER: 'mouseenter' + EVENT_KEY,
- MOUSELEAVE: 'mouseleave' + EVENT_KEY,
- LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY,
- CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
+ SLIDE: "slide".concat(EVENT_KEY),
+ SLID: "slid".concat(EVENT_KEY),
+ KEYDOWN: "keydown".concat(EVENT_KEY),
+ MOUSEENTER: "mouseenter".concat(EVENT_KEY),
+ MOUSELEAVE: "mouseleave".concat(EVENT_KEY),
+ TOUCHEND: "touchend".concat(EVENT_KEY),
+ LOAD_DATA_API: "load".concat(EVENT_KEY).concat(DATA_API_KEY),
+ CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY)
};
-
var ClassName = {
CAROUSEL: 'carousel',
ACTIVE: 'active',
SLIDE: 'slide',
- RIGHT: 'right',
- LEFT: 'left',
+ RIGHT: 'carousel-item-right',
+ LEFT: 'carousel-item-left',
+ NEXT: 'carousel-item-next',
+ PREV: 'carousel-item-prev',
ITEM: 'carousel-item'
};
-
var Selector = {
ACTIVE: '.active',
ACTIVE_ITEM: '.active.carousel-item',
ITEM: '.carousel-item',
- NEXT_PREV: '.next, .prev',
+ NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
INDICATORS: '.carousel-indicators',
DATA_SLIDE: '[data-slide], [data-slide-to]',
DATA_RIDE: '[data-ride="carousel"]'
- };
+ /**
+ * ------------------------------------------------------------------------
+ * Class Definition
+ * ------------------------------------------------------------------------
+ */
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
+ };
var Carousel = function () {
function Carousel(element, config) {
this._items = null;
this._interval = null;
this._activeElement = null;
-
this._isPaused = false;
this._isSliding = false;
-
+ this.touchTimeout = null;
this._config = this._getConfig(config);
this._element = $(element)[0];
this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
this._addEventListeners();
- }
+ } // Getters
- // getters
_createClass(Carousel, [{
- key: 'next',
+ key: "next",
value: function next() {
if (!this._isSliding) {
this._slide(Direction.NEXT);
}
}
}, {
- key: 'nextWhenVisible',
+ key: "nextWhenVisible",
value: function nextWhenVisible() {
// Don't call next when the page isn't visible
- if (!document.hidden) {
+ // or the carousel or its parent isn't visible
+ if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
this.next();
}
}
}, {
- key: 'prev',
+ key: "prev",
value: function prev() {
if (!this._isSliding) {
- this._slide(Direction.PREVIOUS);
+ this._slide(Direction.PREV);
}
}
}, {
- key: 'pause',
+ key: "pause",
value: function pause(event) {
if (!event) {
this._isPaused = true;
if ($(this._element).find(Selector.NEXT_PREV)[0] && _util2.default.supportsTransitionEnd()) {
_util2.default.triggerTransitionEnd(this._element);
+
this.cycle(true);
}
this._interval = null;
}
}, {
- key: 'cycle',
+ key: "cycle",
value: function cycle(event) {
if (!event) {
this._isPaused = false;
}
if (this._config.interval && !this._isPaused) {
- this._interval = setInterval($.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval);
+ this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
}
}
}, {
- key: 'to',
+ key: "to",
value: function to(index) {
var _this = this;
return;
}
- var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
+ var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
this._slide(direction, this._items[index]);
}
}, {
- key: 'dispose',
+ key: "dispose",
value: function dispose() {
$(this._element).off(EVENT_KEY);
$.removeData(this._element, DATA_KEY);
-
this._items = null;
this._config = null;
this._element = null;
this._indicatorsElement = null;
}
}, {
- key: '_getConfig',
+ key: "_getConfig",
value: function _getConfig(config) {
- config = $.extend({}, Default, config);
+ config = _extends({}, Default, config);
+
_util2.default.typeCheckConfig(NAME, config, DefaultType);
+
return config;
}
}, {
- key: '_addEventListeners',
+ key: "_addEventListeners",
value: function _addEventListeners() {
+ var _this2 = this;
+
if (this._config.keyboard) {
- $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this));
+ $(this._element).on(Event.KEYDOWN, function (event) {
+ return _this2._keydown(event);
+ });
}
- if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
- $(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this));
+ if (this._config.pause === 'hover') {
+ $(this._element).on(Event.MOUSEENTER, function (event) {
+ return _this2.pause(event);
+ }).on(Event.MOUSELEAVE, function (event) {
+ return _this2.cycle(event);
+ });
+
+ if ('ontouchstart' in document.documentElement) {
+ // If it's a touch-enabled device, mouseenter/leave are fired as
+ // part of the mouse compatibility events on first tap - the carousel
+ // would stop cycling until user tapped out of it;
+ // here, we listen for touchend, explicitly pause the carousel
+ // (as if it's the second time we tap on it, mouseenter compat event
+ // is NOT fired) and after a timeout (to allow for mouse compatibility
+ // events to fire) we explicitly restart cycling
+ $(this._element).on(Event.TOUCHEND, function () {
+ _this2.pause();
+
+ if (_this2.touchTimeout) {
+ clearTimeout(_this2.touchTimeout);
+ }
+
+ _this2.touchTimeout = setTimeout(function (event) {
+ return _this2.cycle(event);
+ }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);
+ });
+ }
}
}
}, {
- key: '_keydown',
+ key: "_keydown",
value: function _keydown(event) {
- event.preventDefault();
-
if (/input|textarea/i.test(event.target.tagName)) {
return;
}
switch (event.which) {
case ARROW_LEFT_KEYCODE:
+ event.preventDefault();
this.prev();
break;
+
case ARROW_RIGHT_KEYCODE:
+ event.preventDefault();
this.next();
break;
+
default:
- return;
}
}
}, {
- key: '_getItemIndex',
+ key: "_getItemIndex",
value: function _getItemIndex(element) {
this._items = $.makeArray($(element).parent().find(Selector.ITEM));
return this._items.indexOf(element);
}
}, {
- key: '_getItemByDirection',
+ key: "_getItemByDirection",
value: function _getItemByDirection(direction, activeElement) {
var isNextDirection = direction === Direction.NEXT;
- var isPrevDirection = direction === Direction.PREVIOUS;
+ var isPrevDirection = direction === Direction.PREV;
+
var activeIndex = this._getItemIndex(activeElement);
+
var lastItemIndex = this._items.length - 1;
var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
return activeElement;
}
- var delta = direction === Direction.PREVIOUS ? -1 : 1;
+ var delta = direction === Direction.PREV ? -1 : 1;
var itemIndex = (activeIndex + delta) % this._items.length;
-
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
}
}, {
- key: '_triggerSlideEvent',
- value: function _triggerSlideEvent(relatedTarget, directionalClassname) {
+ key: "_triggerSlideEvent",
+ value: function _triggerSlideEvent(relatedTarget, eventDirectionName) {
+ var targetIndex = this._getItemIndex(relatedTarget);
+
+ var fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]);
+
var slideEvent = $.Event(Event.SLIDE, {
relatedTarget: relatedTarget,
- direction: directionalClassname
+ direction: eventDirectionName,
+ from: fromIndex,
+ to: targetIndex
});
-
$(this._element).trigger(slideEvent);
-
return slideEvent;
}
}, {
- key: '_setActiveIndicatorElement',
+ key: "_setActiveIndicatorElement",
value: function _setActiveIndicatorElement(element) {
if (this._indicatorsElement) {
$(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
}
}
}, {
- key: '_slide',
+ key: "_slide",
value: function _slide(direction, element) {
- var _this2 = this;
+ var _this3 = this;
var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
+
+ var activeElementIndex = this._getItemIndex(activeElement);
+
var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
- var isCycling = Boolean(this._interval);
+ var nextElementIndex = this._getItemIndex(nextElement);
- var directionalClassName = direction === Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT;
+ var isCycling = Boolean(this._interval);
+ var directionalClassName;
+ var orderClassName;
+ var eventDirectionName;
+
+ if (direction === Direction.NEXT) {
+ directionalClassName = ClassName.LEFT;
+ orderClassName = ClassName.NEXT;
+ eventDirectionName = Direction.LEFT;
+ } else {
+ directionalClassName = ClassName.RIGHT;
+ orderClassName = ClassName.PREV;
+ eventDirectionName = Direction.RIGHT;
+ }
if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
this._isSliding = false;
return;
}
- var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName);
+ var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
+
if (slideEvent.isDefaultPrevented()) {
return;
}
if (!activeElement || !nextElement) {
- // some weirdness is happening, so we bail
+ // Some weirdness is happening, so we bail
return;
}
var slidEvent = $.Event(Event.SLID, {
relatedTarget: nextElement,
- direction: directionalClassName
+ direction: eventDirectionName,
+ from: activeElementIndex,
+ to: nextElementIndex
});
if (_util2.default.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
-
- $(nextElement).addClass(direction);
+ $(nextElement).addClass(orderClassName);
_util2.default.reflow(nextElement);
$(activeElement).addClass(directionalClassName);
$(nextElement).addClass(directionalClassName);
-
$(activeElement).one(_util2.default.TRANSITION_END, function () {
- $(nextElement).removeClass(directionalClassName).removeClass(direction);
-
- $(nextElement).addClass(ClassName.ACTIVE);
-
- $(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName);
-
- _this2._isSliding = false;
-
+ $(nextElement).removeClass("".concat(directionalClassName, " ").concat(orderClassName)).addClass(ClassName.ACTIVE);
+ $(activeElement).removeClass("".concat(ClassName.ACTIVE, " ").concat(orderClassName, " ").concat(directionalClassName));
+ _this3._isSliding = false;
setTimeout(function () {
- return $(_this2._element).trigger(slidEvent);
+ return $(_this3._element).trigger(slidEvent);
}, 0);
}).emulateTransitionEnd(TRANSITION_DURATION);
} else {
$(activeElement).removeClass(ClassName.ACTIVE);
$(nextElement).addClass(ClassName.ACTIVE);
-
this._isSliding = false;
$(this._element).trigger(slidEvent);
}
}
}
}], [{
- key: '_jQueryInterface',
+ key: "_jQueryInterface",
value: function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
- var _config = $.extend({}, Default, $(this).data());
- if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') {
- $.extend(_config, config);
+ var _config = _extends({}, Default, $(this).data());
+
+ if (_typeof(config) === 'object') {
+ _config = _extends({}, _config, config);
}
var action = typeof config === 'string' ? config : _config.slide;
if (typeof config === 'number') {
data.to(config);
} else if (typeof action === 'string') {
- if (data[action] === undefined) {
- throw new Error('No method named "' + action + '"');
+ if (typeof data[action] === 'undefined') {
+ throw new TypeError("No method named \"".concat(action, "\""));
}
+
data[action]();
} else if (_config.interval) {
data.pause();
});
}
}, {
- key: '_dataApiClickHandler',
+ key: "_dataApiClickHandler",
value: function _dataApiClickHandler(event) {
var selector = _util2.default.getSelectorFromElement(this);
return;
}
- var config = $.extend({}, $(target).data(), $(this).data());
+ var config = _extends({}, $(target).data(), $(this).data());
+
var slideIndex = this.getAttribute('data-slide-to');
if (slideIndex) {
event.preventDefault();
}
}, {
- key: 'VERSION',
+ key: "VERSION",
get: function get() {
return VERSION;
}
}, {
- key: 'Default',
+ key: "Default",
get: function get() {
return Default;
}
* Data Api implementation
* ------------------------------------------------------------------------
*/
-
$(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
-
$(window).on(Event.LOAD_DATA_API, function () {
$(Selector.DATA_RIDE).each(function () {
var $carousel = $(this);
+
Carousel._jQueryInterface.call($carousel, $carousel.data());
});
});
-
/**
* ------------------------------------------------------------------------
* jQuery
$.fn[NAME] = Carousel._jQueryInterface;
$.fn[NAME].Constructor = Carousel;
+
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Carousel._jQueryInterface;
};
return Carousel;
- }(jQuery);
+ }(_jquery2.default);
exports.default = Carousel;
});
\ No newline at end of file
-define(['exports', './util'], function (exports, _util) {
- 'use strict';
+define(["exports", "jquery", "./util"], function (exports, _jquery, _util) {
+ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+ var _jquery2 = _interopRequireDefault(_jquery);
+
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) {
};
}
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
- };
+ function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function _typeof(obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function _typeof(obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+ }
+
+ function _extends() {
+ _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ return _extends.apply(this, arguments);
+ }
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
}
}
- 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);
- }
+ 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;
- };
- }();
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-alpha.4): collapse.js
+ * Bootstrap (v4.0.0): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
-
var Collapse = function ($) {
-
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
-
var NAME = 'collapse';
- var VERSION = '4.0.0-alpha.4';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.collapse';
- var EVENT_KEY = '.' + DATA_KEY;
+ var EVENT_KEY = ".".concat(DATA_KEY);
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 600;
-
var Default = {
toggle: true,
parent: ''
};
-
var DefaultType = {
toggle: 'boolean',
- parent: 'string'
+ parent: '(string|element)'
};
-
var Event = {
- SHOW: 'show' + EVENT_KEY,
- SHOWN: 'shown' + EVENT_KEY,
- HIDE: 'hide' + EVENT_KEY,
- HIDDEN: 'hidden' + EVENT_KEY,
- CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
+ SHOW: "show".concat(EVENT_KEY),
+ SHOWN: "shown".concat(EVENT_KEY),
+ HIDE: "hide".concat(EVENT_KEY),
+ HIDDEN: "hidden".concat(EVENT_KEY),
+ CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY)
};
-
var ClassName = {
- IN: 'in',
+ SHOW: 'show',
COLLAPSE: 'collapse',
COLLAPSING: 'collapsing',
COLLAPSED: 'collapsed'
};
-
var Dimension = {
WIDTH: 'width',
HEIGHT: 'height'
};
-
var Selector = {
- ACTIVES: '.panel > .in, .panel > .collapsing',
+ ACTIVES: '.show, .collapsing',
DATA_TOGGLE: '[data-toggle="collapse"]'
- };
+ /**
+ * ------------------------------------------------------------------------
+ * Class Definition
+ * ------------------------------------------------------------------------
+ */
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
+ };
var Collapse = function () {
function Collapse(element, config) {
this._isTransitioning = false;
this._element = element;
this._config = this._getConfig(config);
- this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]')));
+ this._triggerArray = $.makeArray($("[data-toggle=\"collapse\"][href=\"#".concat(element.id, "\"],") + "[data-toggle=\"collapse\"][data-target=\"#".concat(element.id, "\"]")));
+ var tabToggles = $(Selector.DATA_TOGGLE);
+
+ for (var i = 0; i < tabToggles.length; i++) {
+ var elem = tabToggles[i];
+
+ var selector = _util2.default.getSelectorFromElement(elem);
+
+ if (selector !== null && $(selector).filter(element).length > 0) {
+ this._selector = selector;
+
+ this._triggerArray.push(elem);
+ }
+ }
this._parent = this._config.parent ? this._getParent() : null;
if (this._config.toggle) {
this.toggle();
}
- }
+ } // Getters
- // getters
_createClass(Collapse, [{
- key: 'toggle',
+ key: "toggle",
value: function toggle() {
- if ($(this._element).hasClass(ClassName.IN)) {
+ if ($(this._element).hasClass(ClassName.SHOW)) {
this.hide();
} else {
this.show();
}
}
}, {
- key: 'show',
+ key: "show",
value: function show() {
var _this = this;
- if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) {
+ if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) {
return;
}
- var actives = void 0;
- var activesData = void 0;
+ var actives;
+ var activesData;
if (this._parent) {
- actives = $.makeArray($(Selector.ACTIVES));
- if (!actives.length) {
+ actives = $.makeArray($(this._parent).find(Selector.ACTIVES).filter("[data-parent=\"".concat(this._config.parent, "\"]")));
+
+ if (actives.length === 0) {
actives = null;
}
}
if (actives) {
- activesData = $(actives).data(DATA_KEY);
+ activesData = $(actives).not(this._selector).data(DATA_KEY);
+
if (activesData && activesData._isTransitioning) {
return;
}
var startEvent = $.Event(Event.SHOW);
$(this._element).trigger(startEvent);
+
if (startEvent.isDefaultPrevented()) {
return;
}
if (actives) {
- Collapse._jQueryInterface.call($(actives), 'hide');
+ Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
+
if (!activesData) {
$(actives).data(DATA_KEY, null);
}
var dimension = this._getDimension();
$(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
-
this._element.style[dimension] = 0;
- this._element.setAttribute('aria-expanded', true);
- if (this._triggerArray.length) {
+ if (this._triggerArray.length > 0) {
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
}
this.setTransitioning(true);
var complete = function complete() {
- $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN);
-
+ $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
_this._element.style[dimension] = '';
_this.setTransitioning(false);
}
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
- var scrollSize = 'scroll' + capitalizedDimension;
-
+ var scrollSize = "scroll".concat(capitalizedDimension);
$(this._element).one(_util2.default.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
-
- this._element.style[dimension] = this._element[scrollSize] + 'px';
+ this._element.style[dimension] = "".concat(this._element[scrollSize], "px");
}
}, {
- key: 'hide',
+ key: "hide",
value: function hide() {
var _this2 = this;
- if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) {
+ if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) {
return;
}
var startEvent = $.Event(Event.HIDE);
$(this._element).trigger(startEvent);
+
if (startEvent.isDefaultPrevented()) {
return;
}
var dimension = this._getDimension();
- var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
- this._element.style[dimension] = this._element[offsetDimension] + 'px';
+ this._element.style[dimension] = "".concat(this._element.getBoundingClientRect()[dimension], "px");
_util2.default.reflow(this._element);
- $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN);
+ $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
+
+ if (this._triggerArray.length > 0) {
+ for (var i = 0; i < this._triggerArray.length; i++) {
+ var trigger = this._triggerArray[i];
+
+ var selector = _util2.default.getSelectorFromElement(trigger);
- this._element.setAttribute('aria-expanded', false);
+ if (selector !== null) {
+ var $elem = $(selector);
- if (this._triggerArray.length) {
- $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
+ if (!$elem.hasClass(ClassName.SHOW)) {
+ $(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
+ }
+ }
+ }
}
this.setTransitioning(true);
var complete = function complete() {
_this2.setTransitioning(false);
+
$(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
};
- this._element.style[dimension] = 0;
+ this._element.style[dimension] = '';
if (!_util2.default.supportsTransitionEnd()) {
complete();
$(this._element).one(_util2.default.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
}
}, {
- key: 'setTransitioning',
+ key: "setTransitioning",
value: function setTransitioning(isTransitioning) {
this._isTransitioning = isTransitioning;
}
}, {
- key: 'dispose',
+ key: "dispose",
value: function dispose() {
$.removeData(this._element, DATA_KEY);
-
this._config = null;
this._parent = null;
this._element = null;
this._isTransitioning = null;
}
}, {
- key: '_getConfig',
+ key: "_getConfig",
value: function _getConfig(config) {
- config = $.extend({}, Default, config);
- config.toggle = Boolean(config.toggle); // coerce string values
+ config = _extends({}, Default, config);
+ config.toggle = Boolean(config.toggle); // Coerce string values
+
_util2.default.typeCheckConfig(NAME, config, DefaultType);
+
return config;
}
}, {
- key: '_getDimension',
+ key: "_getDimension",
value: function _getDimension() {
var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
}
}, {
- key: '_getParent',
+ key: "_getParent",
value: function _getParent() {
var _this3 = this;
- var parent = $(this._config.parent)[0];
- var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';
+ var parent = null;
+ if (_util2.default.isElement(this._config.parent)) {
+ parent = this._config.parent; // It's a jQuery object
+
+ if (typeof this._config.parent.jquery !== 'undefined') {
+ parent = this._config.parent[0];
+ }
+ } else {
+ parent = $(this._config.parent)[0];
+ }
+
+ var selector = "[data-toggle=\"collapse\"][data-parent=\"".concat(this._config.parent, "\"]");
$(parent).find(selector).each(function (i, element) {
_this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
});
-
return parent;
}
}, {
- key: '_addAriaAndCollapsedClass',
+ key: "_addAriaAndCollapsedClass",
value: function _addAriaAndCollapsedClass(element, triggerArray) {
if (element) {
- var isOpen = $(element).hasClass(ClassName.IN);
- element.setAttribute('aria-expanded', isOpen);
+ var isOpen = $(element).hasClass(ClassName.SHOW);
- if (triggerArray.length) {
+ if (triggerArray.length > 0) {
$(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
}
}
}
}], [{
- key: '_getTargetFromElement',
+ key: "_getTargetFromElement",
value: function _getTargetFromElement(element) {
var selector = _util2.default.getSelectorFromElement(element);
+
return selector ? $(selector)[0] : null;
}
}, {
- key: '_jQueryInterface',
+ key: "_jQueryInterface",
value: function _jQueryInterface(config) {
return this.each(function () {
var $this = $(this);
var data = $this.data(DATA_KEY);
- var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
+
+ var _config = _extends({}, Default, $this.data(), _typeof(config) === 'object' && config);
if (!data && _config.toggle && /show|hide/.test(config)) {
_config.toggle = false;
}
if (typeof config === 'string') {
- if (data[config] === undefined) {
- throw new Error('No method named "' + config + '"');
+ if (typeof data[config] === 'undefined') {
+ throw new TypeError("No method named \"".concat(config, "\""));
}
+
data[config]();
}
});
}
}, {
- key: 'VERSION',
+ key: "VERSION",
get: function get() {
return VERSION;
}
}, {
- key: 'Default',
+ key: "Default",
get: function get() {
return Default;
}
* Data Api implementation
* ------------------------------------------------------------------------
*/
-
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
- event.preventDefault();
+ // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
+ if (event.currentTarget.tagName === 'A') {
+ event.preventDefault();
+ }
- var target = Collapse._getTargetFromElement(this);
- var data = $(target).data(DATA_KEY);
- var config = data ? 'toggle' : $(this).data();
+ var $trigger = $(this);
- Collapse._jQueryInterface.call($(target), config);
- });
+ var selector = _util2.default.getSelectorFromElement(this);
+
+ $(selector).each(function () {
+ var $target = $(this);
+ var data = $target.data(DATA_KEY);
+ var config = data ? 'toggle' : $trigger.data();
+ Collapse._jQueryInterface.call($target, config);
+ });
+ });
/**
* ------------------------------------------------------------------------
* jQuery
$.fn[NAME] = Collapse._jQueryInterface;
$.fn[NAME].Constructor = Collapse;
+
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Collapse._jQueryInterface;
};
return Collapse;
- }(jQuery);
+ }(_jquery2.default);
exports.default = Collapse;
});
\ No newline at end of file
-define(['exports', './util'], function (exports, _util) {
- 'use strict';
+define(["exports", "jquery", "core/popper", "./util"], function (exports, _jquery, _popper, _util) {
+ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+ var _jquery2 = _interopRequireDefault(_jquery);
+
+ var _popper2 = _interopRequireDefault(_popper);
+
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) {
};
}
+ function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function _typeof(obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function _typeof(obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+ }
+
+ function _extends() {
+ _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ return _extends.apply(this, arguments);
+ }
+
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
- 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);
- }
+ 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;
- };
- }();
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-alpha.4): dropdown.js
+ * Bootstrap (v4.0.0): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
-
var Dropdown = function ($) {
-
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
-
var NAME = 'dropdown';
- var VERSION = '4.0.0-alpha.4';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.dropdown';
- var EVENT_KEY = '.' + DATA_KEY;
+ var EVENT_KEY = ".".concat(DATA_KEY);
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
+
+ var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
+
+ var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
+
var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
+
var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
+
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
+ var REGEXP_KEYDOWN = new RegExp("".concat(ARROW_UP_KEYCODE, "|").concat(ARROW_DOWN_KEYCODE, "|").concat(ESCAPE_KEYCODE));
var Event = {
- HIDE: 'hide' + EVENT_KEY,
- HIDDEN: 'hidden' + EVENT_KEY,
- SHOW: 'show' + EVENT_KEY,
- SHOWN: 'shown' + EVENT_KEY,
- CLICK: 'click' + EVENT_KEY,
- CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
- KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY
+ HIDE: "hide".concat(EVENT_KEY),
+ HIDDEN: "hidden".concat(EVENT_KEY),
+ SHOW: "show".concat(EVENT_KEY),
+ SHOWN: "shown".concat(EVENT_KEY),
+ CLICK: "click".concat(EVENT_KEY),
+ CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY),
+ KEYDOWN_DATA_API: "keydown".concat(EVENT_KEY).concat(DATA_API_KEY),
+ KEYUP_DATA_API: "keyup".concat(EVENT_KEY).concat(DATA_API_KEY)
};
-
var ClassName = {
- BACKDROP: 'dropdown-backdrop',
DISABLED: 'disabled',
- OPEN: 'open'
+ SHOW: 'show',
+ DROPUP: 'dropup',
+ DROPRIGHT: 'dropright',
+ DROPLEFT: 'dropleft',
+ MENURIGHT: 'dropdown-menu-right',
+ MENULEFT: 'dropdown-menu-left',
+ POSITION_STATIC: 'position-static'
};
-
var Selector = {
- BACKDROP: '.dropdown-backdrop',
DATA_TOGGLE: '[data-toggle="dropdown"]',
FORM_CHILD: '.dropdown form',
- ROLE_MENU: '[role="menu"]',
- ROLE_LISTBOX: '[role="listbox"]',
+ MENU: '.dropdown-menu',
NAVBAR_NAV: '.navbar-nav',
- VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a'
+ VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled)'
+ };
+ var AttachmentMap = {
+ TOP: 'top-start',
+ TOPEND: 'top-end',
+ BOTTOM: 'bottom-start',
+ BOTTOMEND: 'bottom-end',
+ RIGHT: 'right-start',
+ RIGHTEND: 'right-end',
+ LEFT: 'left-start',
+ LEFTEND: 'left-end'
};
+ var Default = {
+ offset: 0,
+ flip: false,
+ boundary: 'scrollParent'
+ };
+ var DefaultType = {
+ offset: '(number|string|function)',
+ flip: 'boolean',
+ boundary: '(string|element)'
+ /**
+ * ------------------------------------------------------------------------
+ * Class Definition
+ * ------------------------------------------------------------------------
+ */
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
+ };
var Dropdown = function () {
- function Dropdown(element) {
+ function Dropdown(element, config) {
_classCallCheck(this, Dropdown);
this._element = element;
+ this._popper = null;
+ this._config = this._getConfig(config);
+ this._menu = this._getMenuElement();
+ this._inNavbar = this._detectNavbar();
this._addEventListeners();
- }
+ } // Getters
- // getters
_createClass(Dropdown, [{
- key: 'toggle',
+ key: "toggle",
value: function toggle() {
- if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
- return false;
+ if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {
+ return;
}
- var parent = Dropdown._getParentFromElement(this);
- var isActive = $(parent).hasClass(ClassName.OPEN);
+ var parent = Dropdown._getParentFromElement(this._element);
+
+ var isActive = $(this._menu).hasClass(ClassName.SHOW);
Dropdown._clearMenus();
if (isActive) {
- return false;
- }
-
- if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
-
- // if mobile we use a backdrop because click events don't delegate
- var dropdown = document.createElement('div');
- dropdown.className = ClassName.BACKDROP;
- $(dropdown).insertBefore(this);
- $(dropdown).on('click', Dropdown._clearMenus);
+ return;
}
- var relatedTarget = { relatedTarget: this };
+ var relatedTarget = {
+ relatedTarget: this._element
+ };
var showEvent = $.Event(Event.SHOW, relatedTarget);
-
$(parent).trigger(showEvent);
if (showEvent.isDefaultPrevented()) {
- return false;
+ return;
+ } // Disable totally Popper.js for Dropdown in Navbar
+
+
+ if (!this._inNavbar) {
+ /**
+ * Check for Popper dependency
+ * Popper - https://popper.js.org
+ */
+ if (typeof _popper2.default === 'undefined') {
+ throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
+ }
+
+ var element = this._element; // For dropup with alignment we use the parent as popper container
+
+ if ($(parent).hasClass(ClassName.DROPUP)) {
+ if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) {
+ element = parent;
+ }
+ } // If boundary is not `scrollParent`, then set position to `static`
+ // to allow the menu to "escape" the scroll parent's boundaries
+ // https://github.com/twbs/bootstrap/issues/24251
+
+
+ if (this._config.boundary !== 'scrollParent') {
+ $(parent).addClass(ClassName.POSITION_STATIC);
+ }
+
+ this._popper = new _popper2.default(element, this._menu, this._getPopperConfig());
+ } // If this is a touch-enabled device we add extra
+ // empty mouseover listeners to the body's immediate children;
+ // only needed because of broken event delegation on iOS
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
+
+
+ if ('ontouchstart' in document.documentElement && $(parent).closest(Selector.NAVBAR_NAV).length === 0) {
+ $('body').children().on('mouseover', null, $.noop);
}
- this.focus();
- this.setAttribute('aria-expanded', 'true');
+ this._element.focus();
- $(parent).toggleClass(ClassName.OPEN);
- $(parent).trigger($.Event(Event.SHOWN, relatedTarget));
+ this._element.setAttribute('aria-expanded', true);
- return false;
+ $(this._menu).toggleClass(ClassName.SHOW);
+ $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget));
}
}, {
- key: 'dispose',
+ key: "dispose",
value: function dispose() {
$.removeData(this._element, DATA_KEY);
$(this._element).off(EVENT_KEY);
this._element = null;
+ this._menu = null;
+
+ if (this._popper !== null) {
+ this._popper.destroy();
+
+ this._popper = null;
+ }
+ }
+ }, {
+ key: "update",
+ value: function update() {
+ this._inNavbar = this._detectNavbar();
+
+ if (this._popper !== null) {
+ this._popper.scheduleUpdate();
+ }
}
}, {
- key: '_addEventListeners',
+ key: "_addEventListeners",
value: function _addEventListeners() {
- $(this._element).on(Event.CLICK, this.toggle);
+ var _this = this;
+
+ $(this._element).on(Event.CLICK, function (event) {
+ event.preventDefault();
+ event.stopPropagation();
+
+ _this.toggle();
+ });
+ }
+ }, {
+ key: "_getConfig",
+ value: function _getConfig(config) {
+ config = _extends({}, this.constructor.Default, $(this._element).data(), config);
+
+ _util2.default.typeCheckConfig(NAME, config, this.constructor.DefaultType);
+
+ return config;
+ }
+ }, {
+ key: "_getMenuElement",
+ value: function _getMenuElement() {
+ if (!this._menu) {
+ var parent = Dropdown._getParentFromElement(this._element);
+
+ this._menu = $(parent).find(Selector.MENU)[0];
+ }
+
+ return this._menu;
+ }
+ }, {
+ key: "_getPlacement",
+ value: function _getPlacement() {
+ var $parentDropdown = $(this._element).parent();
+ var placement = AttachmentMap.BOTTOM; // Handle dropup
+
+ if ($parentDropdown.hasClass(ClassName.DROPUP)) {
+ placement = AttachmentMap.TOP;
+
+ if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
+ placement = AttachmentMap.TOPEND;
+ }
+ } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
+ placement = AttachmentMap.RIGHT;
+ } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
+ placement = AttachmentMap.LEFT;
+ } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
+ placement = AttachmentMap.BOTTOMEND;
+ }
+
+ return placement;
+ }
+ }, {
+ key: "_detectNavbar",
+ value: function _detectNavbar() {
+ return $(this._element).closest('.navbar').length > 0;
+ }
+ }, {
+ key: "_getPopperConfig",
+ value: function _getPopperConfig() {
+ var _this2 = this;
+
+ var offsetConf = {};
+
+ if (typeof this._config.offset === 'function') {
+ offsetConf.fn = function (data) {
+ data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets) || {});
+ return data;
+ };
+ } else {
+ offsetConf.offset = this._config.offset;
+ }
+
+ var popperConfig = {
+ placement: this._getPlacement(),
+ modifiers: {
+ offset: offsetConf,
+ flip: {
+ enabled: this._config.flip
+ },
+ preventOverflow: {
+ boundariesElement: this._config.boundary
+ }
+ }
+ };
+ return popperConfig;
}
}], [{
- key: '_jQueryInterface',
+ key: "_jQueryInterface",
value: function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
+ var _config = _typeof(config) === 'object' ? config : null;
+
if (!data) {
- $(this).data(DATA_KEY, data = new Dropdown(this));
+ data = new Dropdown(this, _config);
+ $(this).data(DATA_KEY, data);
}
if (typeof config === 'string') {
- if (data[config] === undefined) {
- throw new Error('No method named "' + config + '"');
+ if (typeof data[config] === 'undefined') {
+ throw new TypeError("No method named \"".concat(config, "\""));
}
- data[config].call(this);
+
+ data[config]();
}
});
}
}, {
- key: '_clearMenus',
+ key: "_clearMenus",
value: function _clearMenus(event) {
- if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {
+ if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
return;
}
- var backdrop = $(Selector.BACKDROP)[0];
- if (backdrop) {
- backdrop.parentNode.removeChild(backdrop);
- }
-
var toggles = $.makeArray($(Selector.DATA_TOGGLE));
for (var i = 0; i < toggles.length; i++) {
var parent = Dropdown._getParentFromElement(toggles[i]);
- var relatedTarget = { relatedTarget: toggles[i] };
- if (!$(parent).hasClass(ClassName.OPEN)) {
+ var context = $(toggles[i]).data(DATA_KEY);
+ var relatedTarget = {
+ relatedTarget: toggles[i]
+ };
+
+ if (!context) {
continue;
}
- if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(parent, event.target)) {
+ var dropdownMenu = context._menu;
+
+ if (!$(parent).hasClass(ClassName.SHOW)) {
+ continue;
+ }
+
+ if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
continue;
}
var hideEvent = $.Event(Event.HIDE, relatedTarget);
$(parent).trigger(hideEvent);
+
if (hideEvent.isDefaultPrevented()) {
continue;
+ } // If this is a touch-enabled device we remove the extra
+ // empty mouseover listeners we added for iOS support
+
+
+ if ('ontouchstart' in document.documentElement) {
+ $('body').children().off('mouseover', null, $.noop);
}
toggles[i].setAttribute('aria-expanded', 'false');
-
- $(parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget));
+ $(dropdownMenu).removeClass(ClassName.SHOW);
+ $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
}
}
}, {
- key: '_getParentFromElement',
+ key: "_getParentFromElement",
value: function _getParentFromElement(element) {
- var parent = void 0;
+ var parent;
+
var selector = _util2.default.getSelectorFromElement(element);
if (selector) {
return parent || element.parentNode;
}
}, {
- key: '_dataApiKeydownHandler',
+ key: "_dataApiKeydownHandler",
value: function _dataApiKeydownHandler(event) {
- if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
+ // If not input/textarea:
+ // - And not a key in REGEXP_KEYDOWN => not a dropdown command
+ // If input/textarea:
+ // - If space key => not a dropdown command
+ // - If key is other than escape
+ // - If key is not up or down => not a dropdown command
+ // - If trigger inside the menu => not a dropdown command
+ if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
return;
}
}
var parent = Dropdown._getParentFromElement(this);
- var isActive = $(parent).hasClass(ClassName.OPEN);
- if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) {
+ var isActive = $(parent).hasClass(ClassName.SHOW);
+ if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
if (event.which === ESCAPE_KEYCODE) {
var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
$(toggle).trigger('focus');
return;
}
- var items = $.makeArray($(Selector.VISIBLE_ITEMS));
+ var items = $(parent).find(Selector.VISIBLE_ITEMS).get();
- items = items.filter(function (item) {
- return item.offsetWidth || item.offsetHeight;
- });
-
- if (!items.length) {
+ if (items.length === 0) {
return;
}
var index = items.indexOf(event.target);
if (event.which === ARROW_UP_KEYCODE && index > 0) {
- // up
+ // Up
index--;
}
if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
- // down
+ // Down
index++;
}
items[index].focus();
}
}, {
- key: 'VERSION',
+ key: "VERSION",
get: function get() {
return VERSION;
}
+ }, {
+ key: "Default",
+ get: function get() {
+ return Default;
+ }
+ }, {
+ key: "DefaultType",
+ get: function get() {
+ return DefaultType;
+ }
}]);
return Dropdown;
* Data Api implementation
* ------------------------------------------------------------------------
*/
+ $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on("".concat(Event.CLICK_DATA_API, " ").concat(Event.KEYUP_DATA_API), Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
+ event.preventDefault();
+ event.stopPropagation();
- $(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) {
+ Dropdown._jQueryInterface.call($(this), 'toggle');
+ }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
e.stopPropagation();
});
-
/**
* ------------------------------------------------------------------------
* jQuery
$.fn[NAME] = Dropdown._jQueryInterface;
$.fn[NAME].Constructor = Dropdown;
+
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Dropdown._jQueryInterface;
};
return Dropdown;
- }(jQuery);
+ }(_jquery2.default, _popper2.default);
exports.default = Dropdown;
});
\ No newline at end of file
if (msg !== '') {
parent.addClass('has-danger');
parent.data('client-validation-error', true);
- $(element).addClass('form-control-danger');
+ $(element).addClass('is-invalid');
$(element).attr('aria-describedby', feedback.attr('id'));
$(element).attr('aria-invalid', true);
feedback.attr('tabindex', 0);
if (parent.data('client-validation-error') === true) {
parent.removeClass('has-danger');
parent.data('client-validation-error', false);
- $(element).removeClass('form-control-danger');
+ $(element).removeClass('is-invalid');
$(element).removeAttr('aria-describedby');
$(element).attr('aria-invalid', false);
feedback.hide();
-define(['exports', './util'], function (exports, _util) {
- 'use strict';
+define(["exports", "jquery", "./util"], function (exports, _jquery, _util) {
+ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+ var _jquery2 = _interopRequireDefault(_jquery);
+
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) {
};
}
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
- };
+ function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function _typeof(obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function _typeof(obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+ }
+
+ function _extends() {
+ _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ return _extends.apply(this, arguments);
+ }
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
}
}
- 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);
- }
+ 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;
- };
- }();
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-alpha.4): modal.js
+ * Bootstrap (v4.0.0): modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
-
var Modal = function ($) {
-
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
-
var NAME = 'modal';
- var VERSION = '4.0.0-alpha.4';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.modal';
- var EVENT_KEY = '.' + DATA_KEY;
+ var EVENT_KEY = ".".concat(DATA_KEY);
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 300;
focus: true,
show: true
};
-
var DefaultType = {
backdrop: '(boolean|string)',
keyboard: 'boolean',
focus: 'boolean',
show: 'boolean'
};
-
var Event = {
- HIDE: 'hide' + EVENT_KEY,
- HIDDEN: 'hidden' + EVENT_KEY,
- SHOW: 'show' + EVENT_KEY,
- SHOWN: 'shown' + EVENT_KEY,
- FOCUSIN: 'focusin' + EVENT_KEY,
- RESIZE: 'resize' + EVENT_KEY,
- CLICK_DISMISS: 'click.dismiss' + EVENT_KEY,
- KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY,
- MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY,
- MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY,
- CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
+ HIDE: "hide".concat(EVENT_KEY),
+ HIDDEN: "hidden".concat(EVENT_KEY),
+ SHOW: "show".concat(EVENT_KEY),
+ SHOWN: "shown".concat(EVENT_KEY),
+ FOCUSIN: "focusin".concat(EVENT_KEY),
+ RESIZE: "resize".concat(EVENT_KEY),
+ CLICK_DISMISS: "click.dismiss".concat(EVENT_KEY),
+ KEYDOWN_DISMISS: "keydown.dismiss".concat(EVENT_KEY),
+ MOUSEUP_DISMISS: "mouseup.dismiss".concat(EVENT_KEY),
+ MOUSEDOWN_DISMISS: "mousedown.dismiss".concat(EVENT_KEY),
+ CLICK_DATA_API: "click".concat(EVENT_KEY).concat(DATA_API_KEY)
};
-
var ClassName = {
SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
BACKDROP: 'modal-backdrop',
OPEN: 'modal-open',
FADE: 'fade',
- IN: 'in'
+ SHOW: 'show'
};
-
var Selector = {
DIALOG: '.modal-dialog',
DATA_TOGGLE: '[data-toggle="modal"]',
DATA_DISMISS: '[data-dismiss="modal"]',
- FIXED_CONTENT: '.navbar-fixed-top, .navbar-fixed-bottom, .is-fixed'
- };
+ FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
+ STICKY_CONTENT: '.sticky-top',
+ NAVBAR_TOGGLER: '.navbar-toggler'
+ /**
+ * ------------------------------------------------------------------------
+ * Class Definition
+ * ------------------------------------------------------------------------
+ */
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
+ };
var Modal = function () {
function Modal(element, config) {
this._ignoreBackdropClick = false;
this._originalBodyPadding = 0;
this._scrollbarWidth = 0;
- }
+ } // Getters
- // getters
_createClass(Modal, [{
- key: 'toggle',
+ key: "toggle",
value: function toggle(relatedTarget) {
return this._isShown ? this.hide() : this.show(relatedTarget);
}
}, {
- key: 'show',
+ key: "show",
value: function show(relatedTarget) {
var _this = this;
+ if (this._isTransitioning || this._isShown) {
+ return;
+ }
+
+ if (_util2.default.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
+ this._isTransitioning = true;
+ }
+
var showEvent = $.Event(Event.SHOW, {
relatedTarget: relatedTarget
});
-
$(this._element).trigger(showEvent);
if (this._isShown || showEvent.isDefaultPrevented()) {
this._isShown = true;
this._checkScrollbar();
+
this._setScrollbar();
+ this._adjustDialog();
+
$(document.body).addClass(ClassName.OPEN);
this._setEscapeEvent();
- this._setResizeEvent();
- $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this));
+ this._setResizeEvent();
+ $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
+ return _this.hide(event);
+ });
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
$(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
if ($(event.target).is(_this._element)) {
});
});
- this._showBackdrop($.proxy(this._showElement, this, relatedTarget));
+ this._showBackdrop(function () {
+ return _this._showElement(relatedTarget);
+ });
}
}, {
- key: 'hide',
+ key: "hide",
value: function hide(event) {
+ var _this2 = this;
+
if (event) {
event.preventDefault();
}
- var hideEvent = $.Event(Event.HIDE);
+ if (this._isTransitioning || !this._isShown) {
+ return;
+ }
+ var hideEvent = $.Event(Event.HIDE);
$(this._element).trigger(hideEvent);
if (!this._isShown || hideEvent.isDefaultPrevented()) {
}
this._isShown = false;
+ var transition = _util2.default.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
+
+ if (transition) {
+ this._isTransitioning = true;
+ }
this._setEscapeEvent();
+
this._setResizeEvent();
$(document).off(Event.FOCUSIN);
-
- $(this._element).removeClass(ClassName.IN);
-
+ $(this._element).removeClass(ClassName.SHOW);
$(this._element).off(Event.CLICK_DISMISS);
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
- if (_util2.default.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
-
- $(this._element).one(_util2.default.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION);
+ if (transition) {
+ $(this._element).one(_util2.default.TRANSITION_END, function (event) {
+ return _this2._hideModal(event);
+ }).emulateTransitionEnd(TRANSITION_DURATION);
} else {
this._hideModal();
}
}
}, {
- key: 'dispose',
+ key: "dispose",
value: function dispose() {
$.removeData(this._element, DATA_KEY);
-
- $(window).off(EVENT_KEY);
- $(document).off(EVENT_KEY);
- $(this._element).off(EVENT_KEY);
- $(this._backdrop).off(EVENT_KEY);
-
+ $(window, document, this._element, this._backdrop).off(EVENT_KEY);
this._config = null;
this._element = null;
this._dialog = null;
this._isShown = null;
this._isBodyOverflowing = null;
this._ignoreBackdropClick = null;
- this._originalBodyPadding = null;
this._scrollbarWidth = null;
}
}, {
- key: '_getConfig',
+ key: "handleUpdate",
+ value: function handleUpdate() {
+ this._adjustDialog();
+ }
+ }, {
+ key: "_getConfig",
value: function _getConfig(config) {
- config = $.extend({}, Default, config);
+ config = _extends({}, Default, config);
+
_util2.default.typeCheckConfig(NAME, config, DefaultType);
+
return config;
}
}, {
- key: '_showElement',
+ key: "_showElement",
value: function _showElement(relatedTarget) {
- var _this2 = this;
+ var _this3 = this;
var transition = _util2.default.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
- // don't move modals dom position
+ // Don't move modal's DOM position
document.body.appendChild(this._element);
}
this._element.style.display = 'block';
+
this._element.removeAttribute('aria-hidden');
+
this._element.scrollTop = 0;
if (transition) {
_util2.default.reflow(this._element);
}
- $(this._element).addClass(ClassName.IN);
+ $(this._element).addClass(ClassName.SHOW);
if (this._config.focus) {
this._enforceFocus();
});
var transitionComplete = function transitionComplete() {
- if (_this2._config.focus) {
- _this2._element.focus();
+ if (_this3._config.focus) {
+ _this3._element.focus();
}
- $(_this2._element).trigger(shownEvent);
+
+ _this3._isTransitioning = false;
+ $(_this3._element).trigger(shownEvent);
};
if (transition) {
}
}
}, {
- key: '_enforceFocus',
+ key: "_enforceFocus",
value: function _enforceFocus() {
- var _this3 = this;
+ var _this4 = this;
- $(document).off(Event.FOCUSIN) // guard against infinite focus loop
+ $(document).off(Event.FOCUSIN) // Guard against infinite focus loop
.on(Event.FOCUSIN, function (event) {
- if (document !== event.target && _this3._element !== event.target && !$(_this3._element).has(event.target).length) {
- _this3._element.focus();
+ if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
+ _this4._element.focus();
}
});
}
}, {
- key: '_setEscapeEvent',
+ key: "_setEscapeEvent",
value: function _setEscapeEvent() {
- var _this4 = this;
+ var _this5 = this;
if (this._isShown && this._config.keyboard) {
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
if (event.which === ESCAPE_KEYCODE) {
- _this4.hide();
+ event.preventDefault();
+
+ _this5.hide();
}
});
} else if (!this._isShown) {
}
}
}, {
- key: '_setResizeEvent',
+ key: "_setResizeEvent",
value: function _setResizeEvent() {
+ var _this6 = this;
+
if (this._isShown) {
- $(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this));
+ $(window).on(Event.RESIZE, function (event) {
+ return _this6.handleUpdate(event);
+ });
} else {
$(window).off(Event.RESIZE);
}
}
}, {
- key: '_hideModal',
+ key: "_hideModal",
value: function _hideModal() {
- var _this5 = this;
+ var _this7 = this;
this._element.style.display = 'none';
- this._element.setAttribute('aria-hidden', 'true');
+
+ this._element.setAttribute('aria-hidden', true);
+
+ this._isTransitioning = false;
+
this._showBackdrop(function () {
$(document.body).removeClass(ClassName.OPEN);
- _this5._resetAdjustments();
- _this5._resetScrollbar();
- $(_this5._element).trigger(Event.HIDDEN);
+
+ _this7._resetAdjustments();
+
+ _this7._resetScrollbar();
+
+ $(_this7._element).trigger(Event.HIDDEN);
});
}
}, {
- key: '_removeBackdrop',
+ key: "_removeBackdrop",
value: function _removeBackdrop() {
if (this._backdrop) {
$(this._backdrop).remove();
}
}
}, {
- key: '_showBackdrop',
+ key: "_showBackdrop",
value: function _showBackdrop(callback) {
- var _this6 = this;
+ var _this8 = this;
var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
if (this._isShown && this._config.backdrop) {
var doAnimate = _util2.default.supportsTransitionEnd() && animate;
-
this._backdrop = document.createElement('div');
this._backdrop.className = ClassName.BACKDROP;
}
$(this._backdrop).appendTo(document.body);
-
$(this._element).on(Event.CLICK_DISMISS, function (event) {
- if (_this6._ignoreBackdropClick) {
- _this6._ignoreBackdropClick = false;
+ if (_this8._ignoreBackdropClick) {
+ _this8._ignoreBackdropClick = false;
return;
}
+
if (event.target !== event.currentTarget) {
return;
}
- if (_this6._config.backdrop === 'static') {
- _this6._element.focus();
+
+ if (_this8._config.backdrop === 'static') {
+ _this8._element.focus();
} else {
- _this6.hide();
+ _this8.hide();
}
});
_util2.default.reflow(this._backdrop);
}
- $(this._backdrop).addClass(ClassName.IN);
+ $(this._backdrop).addClass(ClassName.SHOW);
if (!callback) {
return;
$(this._backdrop).one(_util2.default.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
} else if (!this._isShown && this._backdrop) {
- $(this._backdrop).removeClass(ClassName.IN);
+ $(this._backdrop).removeClass(ClassName.SHOW);
var callbackRemove = function callbackRemove() {
- _this6._removeBackdrop();
+ _this8._removeBackdrop();
+
if (callback) {
callback();
}
}
}
}, {
- key: '_handleUpdate',
- value: function _handleUpdate() {
- this._adjustDialog();
- }
- }, {
- key: '_adjustDialog',
+ key: "_adjustDialog",
value: function _adjustDialog() {
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
if (!this._isBodyOverflowing && isModalOverflowing) {
- this._element.style.paddingLeft = this._scrollbarWidth + 'px';
+ this._element.style.paddingLeft = "".concat(this._scrollbarWidth, "px");
}
if (this._isBodyOverflowing && !isModalOverflowing) {
- this._element.style.paddingRight = this._scrollbarWidth + 'px';
+ this._element.style.paddingRight = "".concat(this._scrollbarWidth, "px");
}
}
}, {
- key: '_resetAdjustments',
+ key: "_resetAdjustments",
value: function _resetAdjustments() {
this._element.style.paddingLeft = '';
this._element.style.paddingRight = '';
}
}, {
- key: '_checkScrollbar',
+ key: "_checkScrollbar",
value: function _checkScrollbar() {
- this._isBodyOverflowing = document.body.clientWidth < window.innerWidth;
+ var rect = document.body.getBoundingClientRect();
+ this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
this._scrollbarWidth = this._getScrollbarWidth();
}
}, {
- key: '_setScrollbar',
+ key: "_setScrollbar",
value: function _setScrollbar() {
- var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
-
- this._originalBodyPadding = document.body.style.paddingRight || '';
+ var _this9 = this;
if (this._isBodyOverflowing) {
- document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px';
+ // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
+ // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
+ // Adjust fixed content padding
+ $(Selector.FIXED_CONTENT).each(function (index, element) {
+ var actualPadding = $(element)[0].style.paddingRight;
+ var calculatedPadding = $(element).css('padding-right');
+ $(element).data('padding-right', actualPadding).css('padding-right', "".concat(parseFloat(calculatedPadding) + _this9._scrollbarWidth, "px"));
+ }); // Adjust sticky content margin
+
+ $(Selector.STICKY_CONTENT).each(function (index, element) {
+ var actualMargin = $(element)[0].style.marginRight;
+ var calculatedMargin = $(element).css('margin-right');
+ $(element).data('margin-right', actualMargin).css('margin-right', "".concat(parseFloat(calculatedMargin) - _this9._scrollbarWidth, "px"));
+ }); // Adjust navbar-toggler margin
+
+ $(Selector.NAVBAR_TOGGLER).each(function (index, element) {
+ var actualMargin = $(element)[0].style.marginRight;
+ var calculatedMargin = $(element).css('margin-right');
+ $(element).data('margin-right', actualMargin).css('margin-right', "".concat(parseFloat(calculatedMargin) + _this9._scrollbarWidth, "px"));
+ }); // Adjust body padding
+
+ var actualPadding = document.body.style.paddingRight;
+ var calculatedPadding = $('body').css('padding-right');
+ $('body').data('padding-right', actualPadding).css('padding-right', "".concat(parseFloat(calculatedPadding) + this._scrollbarWidth, "px"));
}
}
}, {
- key: '_resetScrollbar',
+ key: "_resetScrollbar",
value: function _resetScrollbar() {
- document.body.style.paddingRight = this._originalBodyPadding;
+ // Restore fixed content padding
+ $(Selector.FIXED_CONTENT).each(function (index, element) {
+ var padding = $(element).data('padding-right');
+
+ if (typeof padding !== 'undefined') {
+ $(element).css('padding-right', padding).removeData('padding-right');
+ }
+ }); // Restore sticky content and navbar-toggler margin
+
+ $("".concat(Selector.STICKY_CONTENT, ", ").concat(Selector.NAVBAR_TOGGLER)).each(function (index, element) {
+ var margin = $(element).data('margin-right');
+
+ if (typeof margin !== 'undefined') {
+ $(element).css('margin-right', margin).removeData('margin-right');
+ }
+ }); // Restore body padding
+
+ var padding = $('body').data('padding-right');
+
+ if (typeof padding !== 'undefined') {
+ $('body').css('padding-right', padding).removeData('padding-right');
+ }
}
}, {
- key: '_getScrollbarWidth',
+ key: "_getScrollbarWidth",
value: function _getScrollbarWidth() {
// thx d.walsh
var scrollDiv = document.createElement('div');
scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
document.body.appendChild(scrollDiv);
- var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
+ var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
return scrollbarWidth;
}
}], [{
- key: '_jQueryInterface',
+ key: "_jQueryInterface",
value: function _jQueryInterface(config, relatedTarget) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
- var _config = $.extend({}, Modal.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
+
+ var _config = _extends({}, Modal.Default, $(this).data(), _typeof(config) === 'object' && config);
if (!data) {
data = new Modal(this, _config);
}
if (typeof config === 'string') {
- if (data[config] === undefined) {
- throw new Error('No method named "' + config + '"');
+ if (typeof data[config] === 'undefined') {
+ throw new TypeError("No method named \"".concat(config, "\""));
}
+
data[config](relatedTarget);
} else if (_config.show) {
data.show(relatedTarget);
});
}
}, {
- key: 'VERSION',
+ key: "VERSION",
get: function get() {
return VERSION;
}
}, {
- key: 'Default',
+ key: "Default",
get: function get() {
return Default;
}
* Data Api implementation
* ------------------------------------------------------------------------
*/
-
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
- var _this7 = this;
+ var _this10 = this;
+
+ var target;
- var target = void 0;
var selector = _util2.default.getSelectorFromElement(this);
if (selector) {
target = $(selector)[0];
}
- var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data());
+ var config = $(target).data(DATA_KEY) ? 'toggle' : _extends({}, $(target).data(), $(this).data());
- if (this.tagName === 'A') {
+ if (this.tagName === 'A' || this.tagName === 'AREA') {
event.preventDefault();
}
var $target = $(target).one(Event.SHOW, function (showEvent) {
if (showEvent.isDefaultPrevented()) {
- // only register focus restorer if modal will actually get shown
+ // Only register focus restorer if modal will actually get shown
return;
}
$target.one(Event.HIDDEN, function () {
- if ($(_this7).is(':visible')) {
- _this7.focus();
+ if ($(_this10).is(':visible')) {
+ _this10.focus();
}
});
});
Modal._jQueryInterface.call($(target), config, this);
});
-
/**
* ------------------------------------------------------------------------
* jQuery
$.fn[NAME] = Modal._jQueryInterface;
$.fn[NAME].Constructor = Modal;
+
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Modal._jQueryInterface;
};
return Modal;
- }(jQuery);
+ }(_jquery2.default);
exports.default = Modal;
});
\ No newline at end of file
-define(['exports', './tooltip'], function (exports, _tooltip) {
- 'use strict';
+define(["exports", "jquery", "./tooltip"], function (exports, _jquery, _tooltip) {
+ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+ var _jquery2 = _interopRequireDefault(_jquery);
+
var _tooltip2 = _interopRequireDefault(_tooltip);
function _interopRequireDefault(obj) {
};
}
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
- };
+ function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function _typeof(obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function _typeof(obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+ }
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
}
}
- 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);
- }
+ 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;
- };
- }();
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
function _possibleConstructorReturn(self, call) {
- if (!self) {
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
+ return call;
+ }
+
+ if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
- return call && (typeof call === "object" || typeof call === "function") ? call : self;
+ return self;
}
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);
+ throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
+ function _extends() {
+ _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ return _extends.apply(this, arguments);
+ }
+
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-alpha.4): popover.js
+ * Bootstrap (v4.0.0): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
-
var Popover = function ($) {
-
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
-
var NAME = 'popover';
- var VERSION = '4.0.0-alpha.4';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.popover';
- var EVENT_KEY = '.' + DATA_KEY;
+ var EVENT_KEY = ".".concat(DATA_KEY);
var JQUERY_NO_CONFLICT = $.fn[NAME];
+ var CLASS_PREFIX = 'bs-popover';
+ var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)".concat(CLASS_PREFIX, "\\S+"), 'g');
- var Default = $.extend({}, _tooltip2.default.Default, {
+ var Default = _extends({}, _tooltip2.default.Default, {
placement: 'right',
trigger: 'click',
content: '',
- template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
+ template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
});
- var DefaultType = $.extend({}, _tooltip2.default.DefaultType, {
+ var DefaultType = _extends({}, _tooltip2.default.DefaultType, {
content: '(string|element|function)'
});
var ClassName = {
FADE: 'fade',
- IN: 'in'
+ SHOW: 'show'
};
-
var Selector = {
- TITLE: '.popover-title',
- CONTENT: '.popover-content',
- ARROW: '.popover-arrow'
+ TITLE: '.popover-header',
+ CONTENT: '.popover-body'
};
-
var Event = {
- HIDE: 'hide' + EVENT_KEY,
- HIDDEN: 'hidden' + EVENT_KEY,
- SHOW: 'show' + EVENT_KEY,
- SHOWN: 'shown' + EVENT_KEY,
- INSERTED: 'inserted' + EVENT_KEY,
- CLICK: 'click' + EVENT_KEY,
- FOCUSIN: 'focusin' + EVENT_KEY,
- FOCUSOUT: 'focusout' + EVENT_KEY,
- MOUSEENTER: 'mouseenter' + EVENT_KEY,
- MOUSELEAVE: 'mouseleave' + EVENT_KEY
- };
+ HIDE: "hide".concat(EVENT_KEY),
+ HIDDEN: "hidden".concat(EVENT_KEY),
+ SHOW: "show".concat(EVENT_KEY),
+ SHOWN: "shown".concat(EVENT_KEY),
+ INSERTED: "inserted".concat(EVENT_KEY),
+ CLICK: "click".concat(EVENT_KEY),
+ FOCUSIN: "focusin".concat(EVENT_KEY),
+ FOCUSOUT: "focusout".concat(EVENT_KEY),
+ MOUSEENTER: "mouseenter".concat(EVENT_KEY),
+ MOUSELEAVE: "mouseleave".concat(EVENT_KEY)
+ /**
+ * ------------------------------------------------------------------------
+ * Class Definition
+ * ------------------------------------------------------------------------
+ */
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
+ };
var Popover = function (_Tooltip) {
_inherits(Popover, _Tooltip);
}
_createClass(Popover, [{
- key: 'isWithContent',
+ key: "isWithContent",
value: function isWithContent() {
return this.getTitle() || this._getContent();
}
}, {
- key: 'getTipElement',
+ key: "addAttachmentClass",
+ value: function addAttachmentClass(attachment) {
+ $(this.getTipElement()).addClass("".concat(CLASS_PREFIX, "-").concat(attachment));
+ }
+ }, {
+ key: "getTipElement",
value: function getTipElement() {
- return this.tip = this.tip || $(this.config.template)[0];
+ this.tip = this.tip || $(this.config.template)[0];
+ return this.tip;
}
}, {
- key: 'setContent',
+ key: "setContent",
value: function setContent() {
- var $tip = $(this.getTipElement());
+ var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
- // we use append for html objects to maintain js events
this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
- this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
- $tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);
+ var content = this._getContent();
+
+ if (typeof content === 'function') {
+ content = content.call(this.element);
+ }
- this.cleanupTether();
+ this.setElementContent($tip.find(Selector.CONTENT), content);
+ $tip.removeClass("".concat(ClassName.FADE, " ").concat(ClassName.SHOW));
}
}, {
- key: '_getContent',
+ key: "_getContent",
value: function _getContent() {
- return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
+ return this.element.getAttribute('data-content') || this.config.content;
+ }
+ }, {
+ key: "_cleanTipClass",
+ value: function _cleanTipClass() {
+ var $tip = $(this.getTipElement());
+ var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
+
+ if (tabClass !== null && tabClass.length > 0) {
+ $tip.removeClass(tabClass.join(''));
+ }
}
}], [{
- key: '_jQueryInterface',
+ key: "_jQueryInterface",
value: function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
- var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
+
+ var _config = _typeof(config) === 'object' ? config : null;
if (!data && /destroy|hide/.test(config)) {
return;
}
if (typeof config === 'string') {
- if (data[config] === undefined) {
- throw new Error('No method named "' + config + '"');
+ if (typeof data[config] === 'undefined') {
+ throw new TypeError("No method named \"".concat(config, "\""));
}
+
data[config]();
}
});
}
}, {
- key: 'VERSION',
+ key: "VERSION",
get: function get() {
return VERSION;
}
}, {
- key: 'Default',
+ key: "Default",
get: function get() {
return Default;
}
}, {
- key: 'NAME',
+ key: "NAME",
get: function get() {
return NAME;
}
}, {
- key: 'DATA_KEY',
+ key: "DATA_KEY",
get: function get() {
return DATA_KEY;
}
}, {
- key: 'Event',
+ key: "Event",
get: function get() {
return Event;
}
}, {
- key: 'EVENT_KEY',
+ key: "EVENT_KEY",
get: function get() {
return EVENT_KEY;
}
}, {
- key: 'DefaultType',
+ key: "DefaultType",
get: function get() {
return DefaultType;
}
* jQuery
* ------------------------------------------------------------------------
*/
-
$.fn[NAME] = Popover._jQueryInterface;
$.fn[NAME].Constructor = Popover;
+
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Popover._jQueryInterface;
};
return Popover;
- }(jQuery);
+ }(_jquery2.default);
exports.default = Popover;
});
\ No newline at end of file
-define(['exports', './util'], function (exports, _util) {
- 'use strict';
+define(["exports", "jquery", "./util"], function (exports, _jquery, _util) {
+ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
+ var _jquery2 = _interopRequireDefault(_jquery);
+
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) {
};
}
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
- };
+ function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function _typeof(obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function _typeof(obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+ }
+
+ function _extends() {
+ _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ return _extends.apply(this, arguments);
+ }
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
}
}
- 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);
- }
+ 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;
- };
- }();
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-alpha.4): scrollspy.js
+ * Bootstrap (v4.0.0): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
-
var ScrollSpy = function ($) {
-
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
-
var NAME = 'scrollspy';
- var VERSION = '4.0.0-alpha.4';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.scrollspy';
- var EVENT_KEY = '.' + DATA_KEY;
+ var EVENT_KEY = ".".concat(DATA_KEY);
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
-
var Default = {
offset: 10,
method: 'auto',
target: ''
};
-
var DefaultType = {
offset: 'number',
method: 'string',
target: '(string|element)'
};
-
var Event = {
- ACTIVATE: 'activate' + EVENT_KEY,
- SCROLL: 'scroll' + EVENT_KEY,
- LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY
+ ACTIVATE: "activate".concat(EVENT_KEY),
+ SCROLL: "scroll".concat(EVENT_KEY),
+ LOAD_DATA_API: "load".concat(EVENT_KEY).concat(DATA_API_KEY)
};
-
var ClassName = {
DROPDOWN_ITEM: 'dropdown-item',
DROPDOWN_MENU: 'dropdown-menu',
- NAV_LINK: 'nav-link',
- NAV: 'nav',
ACTIVE: 'active'
};
-
var Selector = {
DATA_SPY: '[data-spy="scroll"]',
ACTIVE: '.active',
- LIST_ITEM: '.list-item',
- LI: 'li',
- LI_DROPDOWN: 'li.dropdown',
+ NAV_LIST_GROUP: '.nav, .list-group',
NAV_LINKS: '.nav-link',
+ NAV_ITEMS: '.nav-item',
+ LIST_ITEMS: '.list-group-item',
DROPDOWN: '.dropdown',
DROPDOWN_ITEMS: '.dropdown-item',
DROPDOWN_TOGGLE: '.dropdown-toggle'
};
-
var OffsetMethod = {
OFFSET: 'offset',
POSITION: 'position'
- };
+ /**
+ * ------------------------------------------------------------------------
+ * Class Definition
+ * ------------------------------------------------------------------------
+ */
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
+ };
var ScrollSpy = function () {
function ScrollSpy(element, config) {
+ var _this = this;
+
_classCallCheck(this, ScrollSpy);
this._element = element;
this._scrollElement = element.tagName === 'BODY' ? window : element;
this._config = this._getConfig(config);
- this._selector = this._config.target + ' ' + Selector.NAV_LINKS + ',' + (this._config.target + ' ' + Selector.DROPDOWN_ITEMS);
+ this._selector = "".concat(this._config.target, " ").concat(Selector.NAV_LINKS, ",") + "".concat(this._config.target, " ").concat(Selector.LIST_ITEMS, ",") + "".concat(this._config.target, " ").concat(Selector.DROPDOWN_ITEMS);
this._offsets = [];
this._targets = [];
this._activeTarget = null;
this._scrollHeight = 0;
-
- $(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this));
-
+ $(this._scrollElement).on(Event.SCROLL, function (event) {
+ return _this._process(event);
+ });
this.refresh();
+
this._process();
- }
+ } // Getters
- // getters
_createClass(ScrollSpy, [{
- key: 'refresh',
+ key: "refresh",
value: function refresh() {
- var _this = this;
-
- var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
+ var _this2 = this;
+ var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
-
var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
-
this._offsets = [];
this._targets = [];
-
this._scrollHeight = this._getScrollHeight();
-
var targets = $.makeArray($(this._selector));
-
targets.map(function (element) {
- var target = void 0;
+ var target;
+
var targetSelector = _util2.default.getSelectorFromElement(element);
if (targetSelector) {
target = $(targetSelector)[0];
}
- if (target && (target.offsetWidth || target.offsetHeight)) {
- // todo (fat): remove sketch reliance on jQuery position/offset
- return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
+ if (target) {
+ var targetBCR = target.getBoundingClientRect();
+
+ if (targetBCR.width || targetBCR.height) {
+ // TODO (fat): remove sketch reliance on jQuery position/offset
+ return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
+ }
}
+
return null;
}).filter(function (item) {
return item;
}).sort(function (a, b) {
return a[0] - b[0];
}).forEach(function (item) {
- _this._offsets.push(item[0]);
- _this._targets.push(item[1]);
+ _this2._offsets.push(item[0]);
+
+ _this2._targets.push(item[1]);
});
}
}, {
- key: 'dispose',
+ key: "dispose",
value: function dispose() {
$.removeData(this._element, DATA_KEY);
$(this._scrollElement).off(EVENT_KEY);
-
this._element = null;
this._scrollElement = null;
this._config = null;
this._scrollHeight = null;
}
}, {
- key: '_getConfig',
+ key: "_getConfig",
value: function _getConfig(config) {
- config = $.extend({}, Default, config);
+ config = _extends({}, Default, config);
if (typeof config.target !== 'string') {
var id = $(config.target).attr('id');
+
if (!id) {
id = _util2.default.getUID(NAME);
$(config.target).attr('id', id);
}
- config.target = '#' + id;
+
+ config.target = "#".concat(id);
}
_util2.default.typeCheckConfig(NAME, config, DefaultType);
return config;
}
}, {
- key: '_getScrollTop',
+ key: "_getScrollTop",
value: function _getScrollTop() {
- return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop;
+ return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
}
}, {
- key: '_getScrollHeight',
+ key: "_getScrollHeight",
value: function _getScrollHeight() {
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
}
}, {
- key: '_process',
+ key: "_getOffsetHeight",
+ value: function _getOffsetHeight() {
+ return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
+ }
+ }, {
+ key: "_process",
value: function _process() {
var scrollTop = this._getScrollTop() + this._config.offset;
+
var scrollHeight = this._getScrollHeight();
- var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
+
+ var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
if (this._scrollHeight !== scrollHeight) {
this.refresh();
if (this._activeTarget !== target) {
this._activate(target);
}
+
+ return;
}
- if (this._activeTarget && scrollTop < this._offsets[0]) {
+ if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
this._activeTarget = null;
+
this._clear();
+
return;
}
for (var i = this._offsets.length; i--;) {
- var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]);
+ var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
if (isActiveTarget) {
this._activate(this._targets[i]);
}
}
}, {
- key: '_activate',
+ key: "_activate",
value: function _activate(target) {
this._activeTarget = target;
this._clear();
- var queries = this._selector.split(',');
+ var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style
+
+
queries = queries.map(function (selector) {
- return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
+ return "".concat(selector, "[data-target=\"").concat(target, "\"],") + "".concat(selector, "[href=\"").concat(target, "\"]");
});
-
var $link = $(queries.join(','));
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
$link.addClass(ClassName.ACTIVE);
} else {
- // todo (fat) this is kinda sus...
- // recursively add actives to tested nav-links
- $link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
+ // Set triggered link as active
+ $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active
+ // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
+
+ $link.parents(Selector.NAV_LIST_GROUP).prev("".concat(Selector.NAV_LINKS, ", ").concat(Selector.LIST_ITEMS)).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item
+
+ $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
}
$(this._scrollElement).trigger(Event.ACTIVATE, {
});
}
}, {
- key: '_clear',
+ key: "_clear",
value: function _clear() {
$(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
}
}], [{
- key: '_jQueryInterface',
+