Difference between revisions of "Widget:RAPIDMyProjectHelper"

From Open Energy Information

(adding check to make sure setstarpage exists)
(add logic to check if button has a no-star class to assist with making overview buttons specific to the page)
 
Line 243: Line 243:
 
   if($('.btn.btn-rapid.btn-state, .btn.btn-rapid.btn-fed, .btn.btn-rapid.btn-overview').length > 0){
 
   if($('.btn.btn-rapid.btn-state, .btn.btn-rapid.btn-fed, .btn.btn-rapid.btn-overview').length > 0){
 
     $('.btn.btn-rapid.btn-state, .btn.btn-rapid.btn-fed, .btn.btn-rapid.btn-overview').each(function(){
 
     $('.btn.btn-rapid.btn-state, .btn.btn-rapid.btn-fed, .btn.btn-rapid.btn-overview').each(function(){
 +
      if($(this).hasClass('no-star')){
 +
        return;
 +
      }
 
       $(this).after('<span class="addProjectLink projectStar" data-toggle="modal" data-target=""><i class="fa fa-star-o"></i><span>Add to Project</span></span>');
 
       $(this).after('<span class="addProjectLink projectStar" data-toggle="modal" data-target=""><i class="fa fa-star-o"></i><span>Add to Project</span></span>');
 
     });
 
     });

Latest revision as of 16:16, 7 March 2019

This applies style and functionality to RAPID pages using the My Projects API feature. It is designed for use solely in the RAPID Toolkit.

Parameters

None


Dependencies


Usage

This widget is included automatically in Template:RAPID-Nav

Example

For an example of this in use, see the Feedback link on any RAPID Toolkit page.